HomeOracleOracle Error ORA-32766: instr with negative offset: use varchar semantics on LOBs

Oracle Error ORA-32766: instr with negative offset: use varchar semantics on LOBs

Oracle Error Message

ORA-32766: instr with negative offset: use varchar semantics on LOBs

Reason for the Error

The current varchar behavior is different. e.g. instr(‘abcd’, ‘cd’, -2, 1) returns 3, whereas instr(to_clob(‘abcd’), ‘cd’, -2, 1) returns 0, (i.e. no match), because the reverse search starts from offset -2, which points to ‘c’ and moving backward, i.e. ‘d’ is ignored. This is symmetric to instr(‘dcba’,’dc’,2,1), which returns 0.

Solution

ORACLE uses the same varchar semantics on LOBs (instr). Using the same example, instr(to_clob(‘abcd’), ‘cd’, -2, 1) will return 3 as in the varchar case.

Share:

Leave a Reply

You May Also Like

Oracle Error Message CLSGN-32767: Internal error. Reason for the Error An unexpected error occurred. Solution Examine the message(s) that accompany...
Oracle Error Message CLSGN-00211: OCR batch operation failed. string Reason for the Error Setting a set of Oracle Cluster Registry...
Oracle Error Message CLSGN-00210: failed to get value for OCR key “string”. string Reason for the Error It was not...