Looping through dataset from Stored procedure

Rudi

Member
Hi

Sorry for this dumb question but how do I loop through the dataset recieved from this stored procedure:

CREATE PACKAGE SP_DSECTIONSPkg AS
TYPE RCT1 IS REF CURSOR RETURN t_sections%ROWTYPE;
END;

CREATE PROCEDURE sp_dsections(
RC1 IN OUT SP_DSECTIONSPkg.RCT1)
AS
StoO_selcnt INTEGER;
StoO_error INTEGER;
StoO_rowcnt INTEGER;
StoO_crowcnt INTEGER := 0;
StoO_fetchstatus INTEGER := 0;
StoO_errmsg VARCHAR2(255);
StoO_sqlstatus INTEGER;
BEGIN
OPEN RC1 FOR
SELECT * FROM t_sections
ORDER BY sectionorder ;
END sp_dsections;

Thanx
 
Just create a TOracleDataSet with the following SQL text:
Code:
begin
  SP_DSECTIONSPkg.sp_dsections(:rc1);
end;
If you declare :rc1 as a cursor variable, you can activate the dataset and go through the result set as usual.

------------------
Marco Kalter
Allround Automations
 
Back
Top