Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Is there a way to avoid this cursor loop (calling a proc) ?
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