Parse Comma Separated String From VARCHAR2 Table Column
538424Aug 16 2007 — edited Jun 18 2013I 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