简体   繁体   中英

DB2 equivalent of [ColumnName]

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

尝试在名称周围使用双引号。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM