Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2003
    Posts
    14

    Unanswered: returning recordsets

    Hi Folks,

    I am no ORACLE-Professional as you might see in the following: :-)

    In SQL-Server, I used to return multiple recordsets in a way like this:

    create procedure test as
    select * from x
    select * from y

    In ORACLE, I was told, it is not that easy, and I should try it with refcursors. Damn, what's that?!?

    Has anyone got any samples to see, how that works?

  2. #2
    Join Date
    Nov 2001
    Location
    Finland, Kirkkonummi
    Posts
    17
    Header:
    CREATE OR REPLACE PACKAGE sample AS

    TYPE cursorType IS REF CURSOR;

    PROCEDURE GetSample (
    O_RESULT_SET OUT cursorType );


    END;

    Package:

    CREATE OR REPLACE PACKAGE BODY Sample AS

    PROCEDURE GetSample (
    O_RESULT_SET OUT cursorType )
    IS
    BEGIN
    OPEN O_RESULT_SET FOR
    SELECT * From x;

    END;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •