DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Ref Cursor in 9i Function

  1. #1
    Join Date
    Nov 2001
    Posts
    5
    The following function is valid in 8i, but when used in 9i, it gives me the following error:

    "TYPES.REF_CURSOR' must be declared"

    CREATE OR REPLACE FUNCTION getUsers
    RETURN TYPES.ref_cursor
    AS
    crsUsers TYPES.ref_cursor;
    BEGIN
    OPEN crsUsers FOR
    SELECT NVL(ID, -1) AS ID,
    NVL((FirstName || ' ' || LastName), 'Null Value') AS Descript,
    NVL(Status, -1) AS Status
    FROM Users
    ORDER BY Descript;
    RETURN crsUsers;
    END;
    /

    Could it possibly be a configuration (or lack thereof) problem?

    Thanks very much in advance for any help!
    Shannon

  2. #2
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    I can tell you that it doesnt work in 8i neither

    ref_cursor is not a standard type, you have to create it previously

    Code:
    create or replace package types
    is
    type ref_cursor is ref cursor;
    end;
    /
    [Edited by pando on 07-25-2002 at 06:06 PM]

  3. #3
    Join Date
    Nov 2001
    Posts
    5
    Pando,

    My mistake. It worked, and thanks very much!

    Shannon

Posting Permissions

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


Click Here to Expand Forum to Full Width