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!

Nested table as string comma separated values

470976May 19 2009 — edited May 19 2009
I would like to insert into a string the content of a nested table as comma separated values.


For example, I have created:

CREATE TYPE u_results AS TABLE OF VARCHAR2(10);
/

CREATE TABLE example_table (
obj_id number,
obj_results u_results)
NESTED TABLE obj_results STORE AS obj_results_t;

INSERT INTO example_table (obj_id, obj_results) VALUES (1, u_results('OK','NOK','NN'));
INSERT INTO example_table (obj_id, obj_results) VALUES (2, u_results('OK','NOK'));

CREATE TABLE example_table2 (
obj_id number,
obj_results2 VARCHAR2(100));

So, In table example_table2 I would like to have the values of obj_results in obj_results2 as string comma separated.

for example
obj_id obj_results2
1 OK,NOK,NN
2 OK,NOK

Any ideas? Thanks
G.
This post has been answered by MichaelS on May 19 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 16 2009
Added on May 19 2009
4 comments
2,817 views