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!

Get distinct items from an array.

BugsJul 17 2006 — edited Jul 17 2006
Guys,
I've a simple nested table as below:
DECLARE
TYPE Colors IS TABLE OF VARCHAR2(16);
rainbow Colors;
BEGIN
rainbow := Colors('Red','Red','Blue','Green','Yellow','Blue','Green');
dbms_output.put_line(rainbow(4));
END;

I'm looking for a generic program to store the the distinct items(comma seperated) of the array onto a string.
ie.
I need a string as below:
'Red,Blue,Green,Yellow'.

Can someone help me out?

Thanks,
Sujeet.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 14 2006
Added on Jul 17 2006
3 comments
555 views