Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7418687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:55:51+00:00 2026-05-29T07:55:51+00:00

I have a question about this procedure. What I am trying to do is

  • 0

I have a question about this procedure. What I am trying to do is to pass in one variable which is the ID, then set a veraible out and return a query / cursor. I got some help on this yesterday, but something is not right and it won’t compile. Can someone help me sort this out? Here is what I have so far.

PROCEDURE SEEKER (pMonkeyID IN VARCHAR2, vMarkCounter OUT Number, seeker_cur OUT TYPES.ref_cursor)
AS
BEGIN

CURSOR seeker_cur IS
    Select monkey_doc_approved, monkey_doc_vaulted
    from monkeyApps 
    where MonkeyID = pMonkeyID
    and monkey_doc_type = 'Banana' 
    order by monkey_doc_approved_timestamp,monkey_doc_type,monkey_doc_approved desc

vMarkCounter number:=0;
BEGIN
  FOR i IN seeker_cur 
  LOOP
    vMarkCounter := vMarkCounter+1;
  END LOOP;
END;

END SEEKER;

I am not sure I am setting my cursor for returning right, and I am not sure I am looping correctly to set my monkeyMarker. the cursor needs to return as well as the marker because I deal with some front end logic with both.

Thanks,
Frank

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T07:55:52+00:00Added an answer on May 29, 2026 at 7:55 am

    I’ll agree with AB Cade I don’t understand why you need the records and the count.There should, however, be little to no need to loop though a cursor in PL\SQL; you can use bulk collect instead, which returns what you want.

    If you don’t have that many records, say less than 50k I would remove the limit 10000 part of the bulk collect; you can just use t_seeker.count, which’ll give you your answer.

    PROCEDURE SEEKER ( pMonkeyID IN VARCHAR2
                     , vMarkCounter OUT Number
                     , c_seeker OUT TYPES.ref_cursor) IS
    
      cursor c_seeker is
        select monkey_doc_approved, monkey_doc_vaulted
          from monkeyApps 
         where MonkeyID = pMonkeyID
           and monkey_doc_type = 'Banana' 
         order by monkey_doc_approved_timestamp
                , monkey_doc_type
                , monkey_doc_approved desc
               ;
    
      type t__seeker is table of c_seeker%rowtype index by binary_integer;
      t_seeker t__seeker;
    
      vMarkCounter number := 0;
    
    begin
    
      open c_seeker;
      loop
    
         fetch c_seeker bulk collect into t_seeker limit 10000;
    
         vMarkCounter := vMarkCounter + t_seeker.count;
    
      end loop;
    
      -- OP want's to return a ref_cursor.
      --close c_seeker;
    
    end seeker;
    /
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A simple question about Stored Procedures. I have one stored procedure collecting a whole
Have a question about stored procedure: How to retrieve the variable's value from stored
I have a question about this question . I posted a reply there but
Hi I have a question about this pointer, when an object is constructed, when
I have already posted a question about this, but the situation has changed sufficiently
I have seen this question about deploying to WebSphere using the WAS ant tasks.
I have a question about locking. This doesn't have to be only about record
I have a question about using new[] . Imagine this: Object.SomeProperty = new[] {string1,
I have little question about how web browser retrieve webpage? I know this User
This question about Timers for windows services got me thinking: Say I have (and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.