RE: Oracle 10g SQL - Parsing Delimited String

"Simoneau, Roger" <[email protected]>
Newsgroups gmane.comp.db.oracle.toad.free
Message-ID <85214F3A9C2FE94F9FF1D7C6456E33F9042B9D96B6@EX-CLUS-MBX-01.abcp.ab.bluecross.ca>
Substr combined with instr would do the job.

Roger S.

From: [email protected] [mailto:[email protected]] On Behalf Of Vikram Vaidyanathan
Sent: Tuesday, January 10, 2012 2:25 PM
To: [email protected]
Subject: [toad] Oracle 10g SQL - Parsing Delimited String


I need to write a generic SQL query to parse a comma delimited string from right to left and return the first non-null value.

Example:
1.  ,,,Database,,10g,,Oracle,,
2.  ,,10g,,,Oracle,,,,,,
3.  ,,,Data,,,Menu,,,Oracle,,,

For all the above examples, the output should be "Oracle"

Appreciate the help.

Thanks,
Vikram


________________________________
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.