以下 SQL 运行 Oracle Text CONTEXT 索引列:
variable label number;
exec :label := 1;
SELECT * FROM TEST_TABLE
WHERE CONTAINS(INDEXEDCOL, 'token', :label) > 0;
结果是:
Error report:
SQL Error: ORA-29909: label for the ancillary operator is not a literal number
29909. 00000 - "label for the ancillary operator is not a literal number"
*Cause: The label used for invoking the ancillary operator is not
a literal number.
*Action: Use a literal number as the label.
我在这里发现了一个类似问题的提及:
https://forums.oracle.com/forums/thread.jspa?threadID=91417
但在我的情况下,使用以下命令更改光标无济于事:
ALTER SESSION SET cursor_sharing='EXACT';
还有这个stackoverflow问题:
但答案不适用。我正在使用 Oracle 11.2.0.3.0