Nested table as string comma separated values
470976May 19 2009 — edited May 19 2009I 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.