Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Package Problem
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 );
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
![]() |
![]() |