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 8812463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:36:42+00:00 2026-06-14T03:36:42+00:00

If I write a simple function doSomething , I can get its result by

  • 0

If I write a simple function doSomething, I can get its result by executing :

select doSomething() from dual;

But, if I wish to call a procedure that has an OUT cursor being passed to it (along with another int parameter), how do I call that procedure inside a query and access the result of the cursor ?

Calling it inside a query is not compulsory.. its just that I want to access the results of that procedure

  • 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-06-14T03:36:44+00:00Added an answer on June 14, 2026 at 3:36 am

    You can create a procedure like

        CREATE OR REPLACE PROCEDURE your_procedure(out_cursor OUT sys_refcursor)
        IS
        BEGIN
            OPEN out_cursor FOR
                SELECT  employee_name
                  FROM  employees;
    
        END;
        /
    

    Once you create your procedure wrap the procedure in a function which returns a cursor like the following

    CREATE OR REPLACE FUNCTION your_function
        RETURN sys_refcursor
    AS
        o_param  sys_refcursor;
    BEGIN
        o_param := NULL;
        your_procedure(o_param);
        RETURN o_param;
    EXCEPTION
        WHEN NO_DATA_FOUND
        THEN
            -- raise                                  
    
        WHEN OTHERS
        THEN
            -- raise
    END your_function;
    /
    

    To see the results from sql do as

    select your_function from dual;
    

    Update 1

    To see result in SQL Developer

    Step 1

    Double click on your results in SQL Developer

    [Results][1]

    Step 2 Single Click on the button with dots. That will pop up the values

    [Grid][2]

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I trying to write a simple function to call unmanaged code from managed code.
I wish to write a simple javascript function that toggles the visibility of a
My question is pretty simple: How can I write a function once and make
I am trying to write a simple Java function that will take a list
I'm trying to write a simple Vim function that takes the name of a
I am trying to write, what I thought was, a simple jQuery function to
I have a simple file read and write function. private void WriteToFile(String filename, String
I just write a simple operator= in Widget,but when I operator= it ,it throws
consider this simple code: $q=mysql_query('SELECT [...]'); while($row=mysql_fetch_assoc($q)){ //Do something with data //And write how
A simple C++ question : is it possible to call a function or another

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.