Problem with Keyword YEAR in a view
Teradata Teradata Discussion Forums Teradata.com Discussion Forum
Visit Teradata.com
Home       Guidelines    Member List
Welcome Guest ( Login | Register )
        


This online forum is for user-to-user discussions of Teradata products, and is not an official customer support channel for Teradata. If you require direct assistance, please contact Teradata support.


Problem with Keyword YEAR in a view Expand / Collapse
Author
Message
Posted 10/8/2009 2:28:38 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 10/8/2009 2:19:21 PM
Posts: 1, Visits: 0
Why does this work....

sel YEAR(Date-1) as TEST_YR

But this does not...

replace view dbowner.TEST_V as
( sel YEAR(Date-1) as TEST_YR ) ;


Is there a simple syntax work around I am missing here to use the keyword function YEAR in a view? Thank you!


Kaye
If I can think it, I can code it....on a good day
Post #17069
Posted 10/8/2009 11:17:04 PM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: Yesterday @ 3:55:54 AM
Posts: 111, Visits: 263
You are running the query through SQL Assistant and if you look in Tools/ Options/ Query you will see that Allow Use of ODBC Extensions In Queries is allowed.
Microsoft ODBC interface is translating your query to what Bill thinks you want.

Turn this off and run the query again, and you get syntax error.

Microsoft ODBC interface does not attempt to translate DDL statements, so you get an error with or without that option.

Use:

replace view TEST_V as
sel Extract(YEAR from Current_Date - 1) as TEST_YR

That will always work.

Post #17071
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 ( 0 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.


All times are GMT -5:00, Time now is 9:49pm

Powered By InstantForum.NET v4.1.4 © 2009
Execution: 0.078. 7 queries. Compression Disabled.