How to use reserved key words as column names

General
Enthusiast

How to use reserved key words as column names

Hi ,

I have to use the Teradata reserved key word "DEC" as a column name in my calender table, If i specify this word in double quotes(" DEC ") working fine.

Any alternative way to use this with out Quotes??

3 REPLIES
Junior Contributor

Re: How to use reserved key words as column names

No.

You should try to avoid reserved names as you have to use those double quotes whenever that column is used in any SQL.

Teradata Employee

Re: How to use reserved key words as column names

You could also use the Unicode Delimited Identifier syntax:

ct calendar (U&"DEC" uescape '#' char (10));

 *** Table has been created.

 *** Total elapsed time was 1 second.

But in your case, "DEC" is the best alternative.

See the SQL fundamentals reference for more details.

Enthusiast

Re: How to use reserved key words as column names

As Dieter suggested to avoid using keywords as it breeds bigger problems in a bigger picture. A table like calendar can be used by others.It may create problems. Also if or when porting an application from one server to another it may create confusion.