mod() in view

Database
Teradata Employee

mod() in view

I tried to use the mod() function in a sql view:

CREATE VIEW a AS
SELECT MOD(hours,15) AS x
FROM facts;

But when I submit the above code I always get an error message:

*** Failure 3706 Syntax error: expected something between the 'SELECT' keyw
ord and the 'MOD' keyword.
Statement# 1, Info =38
*** Total elapsed time was 1 second.

When I submit just the select statement eveything works fine.
Is it not possible to use mod() in sql views?

Thanks,
H.
1 REPLY
Enthusiast

Re: mod() in view

Mod is an ODBC extension - it will work in Queryman if you have the "Allow ODBC Extensions" option set, but does not work in bteq or any other "direct" SQL.

Use:

Create View A as
Select Hours mod 15 ax X
from a;