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 -> Executing Stored Procedure Using REF CURSOR

Executing Stored Procedure Using REF CURSOR

From: M_Belk <mona.r.belk_at_lmco.com>
Date: 20 Nov 2003 14:30:24 -0800
Message-ID: <514b11a9.0311201430.23e1c6ce@posting.google.com>


I have successfully create and compiled a package with a REF CURSOR. I have also create and compiled a procedure that uses the REF CURSOR. However, when I attempt to run the procedure, I get the following: Input truncated to 1 characters

         resultset   rpt_cursor%rowtype;
                     *

ERROR at line 2:
ORA-06550: line 2, column 22:
PLS-00320: the declaration of the type of this expression is incomplete or
malformed

I have tried using sample code straight from a training guide and get the same error message when the resultset is being declared.

I would appreciate any help that you can provide.

The package code:
create or replace package report_pkg
AS TYPE Rpt_type is REF CURSOR;
END report_PKG;
/

The procedure code:
create or replace procedure Inv_Report_proc ( rpt_cursor in out report_pkg.rpt_type) AS
  BEGIN
    OPEN rpt_cursor FOR
   SELECT

   A.FIELD1
 , A.FIELD2
 , B.FIELD3

FROM
    TABLE1 A
  , TABLE2 B
WHERE
    A.FIELD5 = B.FIELD5 end Inv_report_proc;
/

The PL/SQL to run the procedure:
SET SERVEROUTPUT ON
declare rpt_cursor report_pkg.Rpt_type;

         resultset rpt_cursor%rowtype; begin

	inv_report_proc(rpt_cursor);
	fetch rpt_cursor into resultset;
	while rpt_cursor%found loop
		dbms_output.putline(resultset.site);
		fetch rpt_cursor into resultset;
	end loop;

end; Received on Thu Nov 20 2003 - 16:30:24 CST

Original text of this message

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