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!

Using Merge with a cursor

819570Feb 29 2012 — edited Feb 29 2012
Hi,

We're using Oracle 11.2. I am looping through a cursor and using a MERGE statement to load my values into a table.

How do I display the values for a row of my cursor in the USING ( ) clause of the Merge statement?
.
.
.
      CURSOR CPC_LOAD_CUR
      IS
         SELECT t.*
           FROM EDW.TABLE_IM_USING t
           where FILLED_EARLIEST_DATE >= add_months(sysdate, - 24); 

BEGIN  


         FOR i IN CPC_LOAD_CUR
         LOOP
            BEGIN

            MERGE INTO RDW.MART_MEM_MEDS b
                 USING (  < Cursor row goes here but how do I display it?>  ) e
                    ON (b.NDC = e.NDC and e.FILLED_EARLIEST_DATE >= add_months(sysdate, - 24))
.
.   
.
Do I use a Varray?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 28 2012
Added on Feb 29 2012
7 comments
11,328 views