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

  • Home
  • SEARCH
  • 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 6182101
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:08:39+00:00 2026-05-24T01:08:39+00:00

CREATE OR REPLACE PROCEDURE GetEmployeesInDept( c OUT SYS_REFCURSOR) I am having a query related

  • 0
CREATE  OR  REPLACE  PROCEDURE GetEmployeesInDept( c OUT  SYS_REFCURSOR)

I am having a query related to the above Stored Procedures,
That is while defining the cursor we mentioned it as sys_refcursor, and in some, web site I have seen it as REF CURSOR as shown

create or replace procedure GetEmployeesInDept( c out ref cursor)

Please tell me what is the difference between the ref cursor and sys_refcursor.

  • 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-24T01:08:39+00:00Added an answer on May 24, 2026 at 1:08 am

    I’m not sure what you mean by

    create or replace procedure GetEmployeesInDept( c out ref cursor)
    

    I’ve not seen this before and I can’t get a procedure declared like this to compile. Could you please provide sample code or links to where you’ve seen this before?

    What you might have seen is something like the following:

    CREATE OR REPLACE PACKAGE demo AS
    
      TYPE ref_cursor IS REF CURSOR;
    
      PROCEDURE GetEmployeesInDept(c OUT ref_cursor);
    
    END demo;
    /
    
    CREATE OR REPLACE PACKAGE BODY demo AS
    
      PROCEDURE GetEmployeesInDept(c OUT ref_cursor)
      IS
      BEGIN
        RAISE NO_DATA_FOUND;
      END GetEmployeesInDept;
    
    END demo;
    /
    

    In this case, we declare a type to be a REF CURSOR, and use it as an OUT parameter in a stored procedure.

    There is no difference between using a type declared as REF CURSOR and using SYS_REFCURSOR, because SYS_REFCURSOR is defined in the STANDARD package as a REF CURSOR in the same way that we declared the type ref_cursor. In fact, if you’re using Oracle 9i or later, look within your Oracle database installation, in %ORACLE_HOME%\rdbms\admin\stdspec.sql, and you should find the following line somewhere in there:

    type sys_refcursor is ref cursor;
    

    SYS_REFCURSOR was introduced in Oracle 9i. You may find various types declared as REF CURSOR in PL/SQL code that was written before Oracle 9i was released.

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

Sidebar

Related Questions

I've below stored proc: CREATE OR REPLACE PROCEDURE demo.run_demo(v_sql IN VARCHAR2, return_code OUT number)
I developed a PL/SQL stored procedure which returns a sys_refcursor create or replace procedure
I have this stored procedure: CREATE OR REPLACE PROCEDURE LIQUIDACION_OBTENER ( p_Cuenta IN NUMBER,
I've got this procedure: CREATE OR REPLACE PROCEDURE CONV1( pDate IN VARCHAR2, pYear OUT
I have stored-procedure in Oracle database like this: create or replace PROCEDURE EDYTUJ_PRACOWNIKA (PR_IMIE
below is the stored proc I wrote: create or replace procedure test005 as begin
I am trying to write a simple Oracle Stored Procedure: CREATE OR REPLACE PROCEDURE
I have some procedure that perform INSERT statement: CREATE OR REPLACE PROCEDURE potok_insert( p_jfplate
i have a simple oracle stored procedure proc1 as follows: CREATE OR REPLACE PROCEDURE
I have a stored procedure create or replace procedure GETFILE(TableName in VARCHAR2) is No_Rows

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.