NoSnipeLimit
Member
Currently I have a proc:
This will be expanded on later, however i believe this is the correct way to get an IN cursor so one can loop through the dataset.
In delphi, i'm now trying to populate this set as follow:
Is this the correct way to pass a dataset to an oracle proc?
SQL:
CREATE OR REPLACE PROCEDURE CDR.Test(C_CUR IN SYS_REFCURSOR) IS
v_rowid test.text%TYPE;
v_test test.text%TYPE;
v_test2 test.text2%TYPE;
v_test3 test.num%TYPE;
BEGIN
-- LOOP
-- FETCH C_cur INTO v_rowid, v_test, v_test2, v_test3;
-- EXIT WHEN C_cur%NOTFOUND;
-- END LOOP;
null;
END Test;
/
This will be expanded on later, however i believe this is the correct way to get an IN cursor so one can loop through the dataset.
In delphi, i'm now trying to populate this set as follow:
Code:
var
lQuery : TOracleQuery;
lQuery2 : TOracleQuery;
begin
lQuery := TOracleQuery.Create(nil);
lQuery2 := TOracleQuery.Create(nil);
try
lQuery.Session := OracleSession1[0];
lQuery2.Session := OracleSession1[0];
lQuery2.sql.Text := 'SELECT D.rowid ROW_ID, D.* FROM CDR.ANTON_TEST D';
lquery2.Execute;
lQuery.SQL.Text := 'BEGIN execute test(:MyCurs); END;';
lQuery.DeclareVariable('MyCurs', otCursor);
lQuery.SetComplexVariable('MyCurs', lQuery2);
lQuery.Execute;
Finally
FreeAndNil(lQuery);
end;
Is this the correct way to pass a dataset to an oracle proc?