测试ORACLE透明网关连接SQL SERVER时候,发现WHERE 条件引用的列名老是无效。
SQL> SELECT COUNT(1) FROM WHERE Pk_id < 2;
SELECT COUNT(1) FROM WHERE Pk_id < 2
*
? 1 ?????:
ORA-00904: "PK_ID": ?????
SQL> ! oerr ora 904
00904, 00000, "%s: invalid identifier"
// *Cause:
// *Action:
SQL>
此时列名需要用双引号引起来,而且引号内的大小写要和SQL SERVER中的列名一样。
SQL> DESC
?? ????? ??
----------------------------------------- -------- ----------------------------
Pk_Id NOT NULL NUMBER(10)
....
SQL> SELECT COUNT(1) FROM WHERE "PK_ID" < 2;
SELECT COUNT(1) FROM WHERE "PK_ID" < 2
*
? 1 ?????:
ORA-00904: "PK_ID": ?????
SQL> SELECT COUNT(1) FROM WHERE "Pk_Id" <2;
COUNT(1)
----------
1
SQL>
阅读(3444) | 评论(0) | 转发(0) |