Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Cursor problem

Cursor problem

From: Ivan Bajon <ib_at_ed.dk>
Date: Thu, 16 Jul 1998 14:54:34 +0200
Message-ID: <6okt00$bbk$1@news1.tele.dk>


Hi all.

I need some help with cursor declaration/specification. The system is Oracle 7.3.3.5 running on Solaris 2.6. The database is running well and I've got other packages stored and in use without problems. Now I'm trying to rewrite a procedure so that it makes use of a curser. This is what I've tried to do:

(According to PL/SQL User's Guide and Reference Release 2.2, this is the way to do it.)

CREATE OR REPLACE PACKAGE MyPackage IS
  TYPE MYBUFFER IS RECORD (

     SOME_ID    number(10),
     ACTIVITY   SOMETABLE.ACTIVITY%TYPE);

  CURSOR c1 RETURN MYBUFFER;
  procedure MyProcedure;
END;
/

show errors;

CREATE OR REPLACE PACKAGE BODY MyPackage IS   CURSOR c1 RETURN MYBUFFER is
    select 1, ACTIVITY
    from SOMETABLE;
  procedure MyProcedure is
  begin

     for c1rec in c1 LOOP
          commit;             /* just trying to avoid errors for now */
     end loop;

  end;
END;
/

show errors;

This is what I get:

Package created.
No errors.
Warning: Package Body created with compilation errors. Errors for PACKAGE BODY MyPackage:

LINE/COL ERROR

-------- -----------------------------------------------------------------
2/1      PL/SQL: Item ignored
3/2      PL/SQL: SQL Statement ignored

Why? If I remove this "is" in "CURSOR c1 RETURN MYBUFFER is", I get the following:

Package created.
No errors.
Warning: Package Body created with compilation errors. Errors for PACKAGE BODY TILESAS:

LINE/COL ERROR

-------- -----------------------------------------------------------------
3/2      PLS-00103: Traf symbolet "SELECT", hvor en af følgende var
         forventet:
         .
         @ % ; is
         Symbolet "is" erstattede "SELECT" for at fortsætte.

Any chance you could help me out here? I'm really stuck and I need a helping hand.

Thanks in advance
- Ivan Bajon Received on Thu Jul 16 1998 - 07:54:34 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US