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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.