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 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

CREATE OR REPLACE PROCEDURE proc AS CURSOR v_cursor IS BEGIN FOR obj IN v_cursor
I've been calling Oracle stored procedures that return RefCursors in my C# application. A
My procedure is declare here : create or replace PACKAGE MYPKG IS PROCEDURE MYPROCEDURE(
I am trying to create a stored procedure in SQL Server 2008 where I
This is what I currently have: CREATE OR REPLACE TRIGGER MYTRIGGER AFTER INSERT ON
I'm using the following logon trigger on an Oracle 10.2 database: CREATE OR REPLACE
I have a question regarding an update function I created... CREATE OR REPLACE FUNCTION
create or replace trigger insert_test_id before insert on test where(test.name='Ash') begin insert into test(s_no)
I created the following Oracle Directory csvDir : create or replace directory csvDir as
I've recently created these two (unrelated) methods to replace lots of boiler-plate code in

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.