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

Home -> Community -> Usenet -> c.d.o.misc -> Package Problem

Package Problem

From: Oracle Newbie <f93c0532_at_yahoo.com>
Date: Fri, 2 Jul 2004 09:50:26 +0500
Message-ID: <2kk7rkF39n1vU1@uni-berlin.de>


I'm using Toad 7.6 to practise some PL/SQL in office. I've written a Package with the following spec and body

CREATE OR REPLACE PACKAGE Emp_Grade AS

  TYPE rfc IS REF CURSOR;

  PROCEDURE GetEGrade( empno IN NUMBER, rs1 OUT rfc );

  PROCEDURE SetEGrade( rs1 IN rfc );

END Emp_Grade;
/

CREATE OR REPLACE PACKAGE BODY Emp_Grade AS

  PROCEDURE GetEGrade(empno IN NUMBER, rs1 OUT rfc ) IS

     rs2 rfc;

  BEGIN     OPEN rs2 FOR 'SELECT empno, 1 From emp' ;

 rs1 := rs2;

  END;   PROCEDURE SetEGrade(rs1 IN rfc ) IS

     eno NUMBER;
    grd NUMBER;
  BEGIN    FETCH rs1 INTO eno, grd;

   INSERT INTO EMPGRADE VALUES ( eno, grd );

  END; END Emp_Grade;
/

However in the SQL editor when I test the Package by calling one of its procedure like this

DECLARE
  rsg rfc;

BEGIN
   execute emp_grade.GetEGrade(10,rsg);

END; I get the error

ORA-06550: line 5, column 12:
PLS-00103: Encountered the symbol "EMP_GRADE" when expecting one of the
following:

   := . ( @ % ; immediate
The symbol ":=" was substituted for "EMP_GRADE" to continue.

Can any one help?

Also is there a way to insert a row like

  INSERT INTO TBLNAME VALUES ( variable_cursor );

???
thx Received on Thu Jul 01 2004 - 23:50:26 CDT

Original text of this message

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