Reading a CLOB backwards using INSTR
418601May 4 2004 — edited May 4 2004Hi,
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