Jump to content

Assign the return cursor of a procedure to another cursor (pl/sql)


Recommended Posts

Hey up. I'm quite stuck on this after playing around with it for about five hours. Basically I'm working on a pretty extensive Oracle framework, trying to use 1 procedure to populate a cursor in my procedure.

 

So I build up a list of IDs within a cursor:

 

  cursor cPages is
    -- get a list of matching pages
    select pages.page_id
    from (....)

 

That part's no problem. But later I want to loop through the cursor, calling a procedure to populate another cursor. So far I've been trying:

 

  -- get the page information for each page
  for vPage in cPages loop
    getPage(vPage.page_id, pSitecode, pLang, pAuthLevel, cResults, cLocale);
  end loop;

 

Currently this does work but only returns the last page - obviously must be overwriting the cursor each time.

 

Could somebody please point out what I'm doing wrong?

 

Thanks a lot for any help you can give!

 

Adam

From what I've read it's impossible to append or merge anything into a cursor in that way. Normally I'd use a join for something like this, but obviously as it's calling another procedure I can't, and the code within that procedure is about 100 lines long so I can't really just duplicate it. Can anybody suggest a work-around that would allow me to achieve the same thing?

 

Thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.