Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Is there a way to avoid this cursor loop (calling a proc) ?

Is there a way to avoid this cursor loop (calling a proc) ?

From: Chimera <nchimera_at_yahoo.com>
Date: 7 Mar 2003 08:38:44 -0800
Message-ID: <7afde90.0303070838.1ab96021@posting.google.com>


I have this pl/sql code in my stored procedure:


     CURSOR curMem (nThisBatch IN NUMBER) is --this is a parameterized cursor

       select NAME_ID,APPLICATION_ID from CK_HISTORY
       where BATCH_ID = nThisBatch and UPDATE_MP_YN = 'Y';

.
.
     for recMember in curMem(nBatchToSet)  -- setup for cursor loop 	
       loop
           SPkids( recMember.NAME_ID, recMember.APPLICATION_ID);
       end loop;

     commit;

As you can see, this loops through a result set and calls another procedure (SPkids) in the loop.

Can this be done another (more efficient) way without a cursor? Maybe by combining the SQL of the cursor with the procedure call and doing the whole thing in one statement?

TIA Received on Fri Mar 07 2003 - 10:38:44 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US