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!

Getting data into another collection from UNION of 2 collections

RajivTxDec 6 2007 — edited Dec 7 2007

Hi,

I have a requirement like this.

cursor c1 is

select a,b,c,d from abc

UNION

select e,f,g,h from def;


I am replacing cursor with collection variables.

Created collection variables for both the select statements as

select a,b,c,d BULK COLLECT INTO coll_abc from abc;

select e,f,g,h BULK COLLECT INTO coll_def from def;

Now, I want to get the UNION of both these collections into another collection variable.

Can I write

select * BULK COLLECT INTO coll_abc_def from coll_abc,coll_def;

Thanks

Rajiv

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 4 2008
Added on Dec 6 2007
11 comments
858 views