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!

Select the distinct value of a column from bulk collection.

Nagaraja AkkivalliApr 13 2012 — edited Apr 17 2012
Hi All,

I am collecting the data from a query to a table type variable. I need to select a distinct value of a perticular column from the collection.

Collection has followiing values in it.
Col(c).articleid,
Col(c).userkey,
Col(c).origin,
Col(c).addnlorigindata,
Col(c).avdest,
Col(c).dispfmt,
Col(c).sourcecode,
Col(c).success_ind,
Col(c).error_code,
Col(c).entry_createddate,
Col(c).createdby,
Col(c).filenumber,
Col(c).linenumber,
Col(c).acctnum,
Col(c).assetkey,
Col(c).autocompletedterm,
Col(c).accessionnumber,
Col(c).requestdatetime,
Col(c).requestorip,
Col(c).articleordinal,
Col(c).userinitiatedind,
Col(c).captchastatus
I need to select distinct values of a column (e.g: Col(c).sourcecode) from the collection and need to insert it into the table if the value of this column does not exist in the table.

Say, Col(c).sourcecode has the value XYZ, ABC. If the value "XYZ" does not exist in the table then I need to insert into the table and if "ABC" exists in the tables then don't insert it. (something like merge) after seecting distinct values of a column from the collection.

Thanks nad Regards
Nagaraja Akkivalli.
This post has been answered by ChaitanyaGoparaju on Apr 16 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 15 2012
Added on Apr 13 2012
8 comments
3,164 views