Reputation: 1550
I have declared a table array type would like to add a bunch of values to the array so that I can later perform a select distinct from the array.
My values to be added to the array are strings like this:
"1","2","3", .....
I want to add each string to the array maybe something like:
FOR i IN SELECT "1","2","3" LOOP
myarray(i) := ????
then later I want to select distinct values from the array. Is there an easy way to do this?
If I was doing this in SQL server, I would simply create a temp table, insert my values into the table, then select distinct from that table, but I am not sure if this is the best way with oracle?
Upvotes: 0
Views: 390
Reputation: 5294
would this work select distinct t.column_value from table(sys.odcivarchar2list('1','2','3','4','5', '1'))t;
Upvotes: 2