Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DB2 equivalent of [ColumnName]

Tags:

sql

db2

In T-SQL, you can use square brackets to get around the fact that some DB Developer used a reserved keyword as a column name, or put a space in a column name as such:

Select [Date] as OrderDate From Orders

or

Select [Order Date] as OrderDate From Orders

I've been unable to find the equivalent for DB2.

We have a file that was set up long ago with fields that contains what I suspect are illegal characters FOR sql. The file works fine when accessing from RPG, but is throwing an error when accessing via SQL.

I've been unable to find documentation on this after much time spent on Google, Bing, and http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/rzahg/rzahgicca2.htm

like image 275
David Avatar asked Jun 25 '12 17:06

David


1 Answers

Try using double quotes around the name.

like image 149
Gordon Linoff Avatar answered Sep 23 '22 15:09

Gordon Linoff