Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2002
    Posts
    31

    Unanswered: passing cursor as function parameter

    Is it possible to pass a cursor as a function parameter in Oracle PL/SQL as that of recordset in SQL Server/ Access?

  2. #2
    Join Date
    Jul 2003
    Location
    New York
    Posts
    2

    Cool Hope this Helps

    CREATE OR REPLACE FUNCTION TEST1
    (The_Name out sys_refcursor)
    RETURN CHAR IS
    TYPE outputCursor IS REF CURSOR;
    Var1 CHAR(10);

    BEGIN

    OPEN The_Name FOR
    SELECT FIELD1
    INTO Var1
    FROM TABLE;
    RETURN(Var1);
    END;

    CREATE OR REPLACE function TEST2
    return sys_refcursor
    as
    l_cursor sys_refcursor;
    begin
    open l_cursor for
    SELECT Field1, Field2
    FROM table;


    return l_cursor;
    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
  •