如何转义在 Informix 中用作标识符的保留字

How do I escape reserved words used as identifier in Informix

可以在 JDBC 查询中使用定界标识符,它适用于以下数据库,即使对于具有以下定界符的非保留关键字也是如此:

SQLServer:方括号 => [select]

Postgres、Teradata、Oracle、Sybase 和 DB2:双引号 => "select"

HIVE 和 MYSQL:反引号 => `select`

Informix 文档说双引号可以用作分隔符来转义,但它不起作用。

任何见解都会有所帮助。

如果您使用的是 informix JDBC 4.10 版(不确定以前的版本是否支持它),您可以在连接字符串中或通过属性列表传递 DELIMIDENT=Y 参数。

DELIMIDENT 
When set to Y, specifies that strings set off by 
double quotation marks are delimited identifiers

查看文档:Informix environment variables with the IBM Informix JDBC Driver