Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Executing Stored Procedure Using REF CURSOR
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; *
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
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;