I use PL / SQL Developer, and I wrote a procedure to run a report, and I need a procedure to output a result set.
The procedure accepts input parameters and should output a set of results.
I cannot use the view because the procedure calls several APIs that accept the parameters that I pass to the procedure.
I understand from many searches that ref_cursor is possible, but I can't get ti to work.
Simplified version of the procedure:
CREATE OR REPLACE PROCEDURE IFSINFO.SHORTAGE_SHEET (vSite IN VARCHAR2,
vBuyer IN VARCHAR2,
vSupplier IN VARCHAR2,
vCursor OUT SYS_REFCURSOR)
AS
BEGIN
OPEN vCursor FOR
SELECT blah blah blah blah blah blah;
END;
I tried to execute the procedure and display the results using:
BEGIN
vsite := 'S03';
vbuyer := 'AW';
vsupplier := '%';
vcursor refcursor;
IFSINFO.SHORTAGE_SHEET(vsite => :vsite,
vbuyer => :vbuyer,
vsupplier => :vsupplier,
vcursor => :vcursor);
print vcursor;
END;
And:
variable rc refcursor;
exec IFSINFO.SHORTAGE_SHEET('S03','AW','TQ1',:rc2);
print rc2
But nobody is working. please someone can advise that i am at my end.
Thank. Rob