RE: Oracle 10g SQL - Parsing Delimited String

"Simoneau, Roger" <[email protected]>
Newsgroups gmane.comp.db.oracle.toad.free
Message-ID <85214F3A9C2FE94F9FF1D7C6456E33F9042B9D96B8@EX-CLUS-MBX-01.abcp.ab.bluecross.ca>
>> Appreciate if you cna elaborate.

Instr <- oracle function that identifies the position of a value within another value, using a negative starting position indicates a reverse “look up”

So…

In the string “hello world, hello world, hello world”, entering:

Select instr(txt, ‘hello world’) from dual

Will respond with: 1 <- the position of the first occurrence

Select instr(txt, ‘hello world’, -1) from dual

Will respond with: 27 <- the third occurrence

Using substr from the position returned you can structure exactly what you want extracted.

Roger S.

________________________________
This communication, including any attached documentation, is intended only for the person or entity to which it is addressed, and may contain confidential, personal and/or privileged information. Any unauthorized disclosure, copying, or taking action on the contents is strictly prohibited. If you have received this message in error, please contact us immediately so we may correct our records. Please then delete or destroy the original transmission and any subsequent reply.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.