当值 1 未被引用时,将 select 与 Zend 一起使用不返回结果

Using select with Zend not returning results when value 1 is unquoted

使用 PHP、Oracle 和 Zend 1.12。我有一个查询:

SELECT * FROM tablename WHERE id = 1;

通常它应该 return 一行,但不知何故,在更改 Oracle 服务器后(这让我相信这个问题是数据库配置问题),它 return 什么都没有。现在,将整数 1 引用为:

SELECT * FROM tablename WHERE id = '1';

return 行。通过 returning,我是说结果显示给 PHP。 例如,如果我 运行 在 SQL Developer 中使用相同的未引用查询,它 return 正确地记录了该行,这让我相信这不是数据库配置问题,而是 Zend 的问题。

但同一个项目正在其他服务器上使用,完全没有问题returning 未加引号的 1 值。

它只发生在 1 上。任何大于或小于 1 的东西都完美。

关于在哪里查看的建议?

正在将 NLS_NUMERIC_CHARACTERS 设置为“,.”修复了手册状态下的问题:

If you have established a decimal character other than a period (.) with the initialization parameter NLS_NUMERIC_CHARACTERS, then you must specify numeric literals with 'text' notation. In these cases, Oracle automatically converts the text literal to a numeric value.

https://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements003.htm

Oracle 10.2g 确认了此行为。