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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:17:09+00:00 2026-05-27T03:17:09+00:00

Here I have a stored procedure in Oracle: CREATE OR REPLACE PROCEDURE StP_COMPS IS

  • 0

Here I have a stored procedure in Oracle:

CREATE OR REPLACE PROCEDURE StP_COMPS
IS
 CV_1 SYS_REFCURSOR;
BEGIN
 OPEN CV_1  FOR SELECT * FROM COMPUTERS;
END;

When I execute the procedure like EXEC SP_COMPS I get no error, the SQL Developer just shows “ananymous block completed”. Then I change the procedure to a

CREATE OR REPLACE PROCEDURE SP_COMPS
      (cv_1 OUT SYS_REFCURSOR)
IS
BEGIN
 OPEN CV_1  FOR SELECT * FROM COMPUTERS;
END;

and when I execute I get error stating that the number of type of the arguments are wrong. I’m very curious what I could send as an argument to the procedure if it’s just an output parameter. I want to get the result set of the query run inside the procedure. What am I doing wrong here?

P.S. When I try to run the procedure by right clicking the procedure and selecting Run I get:

 DECLARE
  CV_2 sys_refcursor;
 BEGIN

 SP_COMPS(
    CV_2 => CV_2
    );

 :CV_2 := CV_2; -- <--Can't understand this part
 END;
  • 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-27T03:17:09+00:00Added an answer on May 27, 2026 at 3:17 am

    You have a variable, you should execute the procedure like:

    DECLARE
      CV_1 SYS_REFCURSOR;
    BEGIN
      SP_COMPS(CV_1);
      --use cv_1
    END;
    

    UPDATE(after OP update): That’s a simple template for testing. As explained here: Easiest method to test an Oracle Stored Procedure, just run that code, and select ref_cursor as type of cv2 variable.

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

Sidebar

Related Questions

I have to improve some code where an Oracle stored procedure is called from
Here is the definition of the stored procedure: CREATE OR REPLACE PROCEDURE usp_dropTable(schema VARCHAR,
I have an MSSQL2005 stored procedure here, which is supposed to take an XML
Here's my scenario: I have a simple stored procedure that removes a specific set
I want to do following: Make Oracle stored procedure for read all data from
I'm attempting to write a stored procedure in Oracle (which I have come to
I have an Oracle stored procedure that returns a BLOB in an output parameter:
I have a Stored Procedure that returns three record sets. Here it is being
Hi Stackoverflow super stars... Here's my problem. I have a stored procedure that outputs
I am using Oracle 11g, and I have a lot of stored procedure code

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.