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!

Parse Comma Separated String From VARCHAR2 Table Column

538424Aug 16 2007 — edited Jun 18 2013
I am trying to find a way to parse a comma separated string from a VARCHAR2 table column by means of SQL, PL/SQL, function, or procedure with a loop that would give the result in a multi-row output for each string value in between commas from that table column.

I apologize in advance if this has been posted in this forum. I have searched, and will continue to search (posting my resolution to this thread if I find it).

Here is what I am looking for.

--Values from table column
CREATE TABLE table_to_parse (
str VARCHAR2(200)
);

INSERT INTO table_to_parse (str)
VALUES ('one,two,three,four,five,six');
COMMIT;

Desired Output (where length of string varies in the column):

one
two
three
four
five
six



I appreciate any help that can be provided or if someone can point me in the right direction where I can find the resolution to my question.

Kyle
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 16 2013
Added on Aug 16 2007
34 comments
28,889 views