Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Reading a CLOB backwards using INSTR

418601May 4 2004 — edited May 4 2004
Hi,

In practice I will have a CLOB which holds the contents of DBMS_METADATA.GET_DML but just to test the functionality of DBMS_LOB I have created a small string which I can search forwards, left to right, using INSTR:

str CLOB := 'This is a string';
l_pos_is := DBMS_LOB.INSTR(str,'is',1,2) - returns the value 6.

I now would like to read the string backwards from l_pos_is to find the first space. I have read that to get INSTR to search backwards requires that the offset is negative. To start from the end of the search above and backwards do I substract the length of string from l_pos_is to get a negative number for the offset?

Regards,

Sean
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 1 2004
Added on May 4 2004
1 comment
823 views