Thread: Ref Cursor

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    4
    Rep Power
    0

    Ref Cursor


    Hi, I have written this code,,

    create or replace package kit_admin
    as
    TYPE PackRec IS RECORD (pack_cd VARCHAR2(5));
    TYPE crsr IS REF CURSOR RETURN PackRec;
    procedure selectPackages(V_crsr OUT crsr);
    end kit_admin;

    This package gets created nicely but the body is not getting created,,,, Body is as follows.

    create or replace package body kit_admin
    is
    TYPE crsr IS REF CURSOR RETURN PackRec;
    procedure selectPackages(V_crsr OUT crsr)
    is
    V_crsr is
    select package_cd from kit_packages;

    end selectPackages;
    end kit_admin;

    the error while creating this body is as follows:

    Errors for PACKAGE BODY KIT_ADMIN:

    LINE/COL ERROR
    -------- -----------------------------------------------------------------
    6/10 PLS-00103: Encountered the symbol "SELECT" when expecting one of
    the following:
    constant exception <an identifier>
    <a double-quoted delimited-identifier> table LONG_ double ref
    char time timestamp interval date binary national character
    nchar

    9/2 PLS-00103: Encountered the symbol "END" when expecting one of the
    following:
    begin function package pragma procedure subtype type use
    <an identifier> <a double-quoted delimited-identifier> cursor

    LINE/COL ERROR
    -------- -----------------------------------------------------------------
    form current

    Please suggest,,

    Thanks
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    Austin, TX
    Posts
    9
    Rep Power
    0

    Re: Ref Cursor


    What exactly are you trying to do here?
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    New York
    Posts
    19
    Rep Power
    0
    It seems like you're approaching your task with more complicated pl/sql than is necessary...

    As martysb asked, what are you trying to accomplish here?

IMN logo majestic logo threadwatch logo seochat tools logo