I want to get REF Cursor from stored procedure, assign it to some TOraDataSet exemplar and save all its records in the cycle to text file.
But if I do it with
Code: Select all
ds : TOraDataSet;
sres:String;
begin
dmImport.StatListLibClient(ds);1. Is it possible to assign just received cursor to some TOraDataSet variable and immediately set Unidirectional to True to prevent buffering record in cash ?
2. If not, is there another method to save cursor records to client file without buffering ALL them on the client memory ?
3. Additional question. What should I do if I have a DataSet that is NonUnidirectional and linked to TCRDBGrid with TOraDataSource, but I still want to save it to file with switching buffering off?
Thank you!
Code: Select all
// ORA_TYPE_CURSOR is synonym of TOraDataSet
procedure TdmImport.StatListLibClient(o_refcur: ORA_TYPE_CURSOR);
var
tmp : TOraStoredProc;
begin
tmp := TOraStoredProc.Create(nil);
try
tmp.Session := OraSession1;
tmp.StoredProcName := 'cscman.pck_LIB_MANAGEMENT.stat_list_lib_client';
tmp.PrepareSQL;
tmp.ParamByName('i_username').AsString := OraSession1.Username;
tmp.ParamByName('o_refcur').ParamType := ptOutput;
tmp.Execute;
tmp.Open;
O_REFCUR := tmp;
except
on e:Exception do begin
winMainForm.addLog('TdmImport.StatListLibClient' +e.message);
end;
end;
end; Maxim
Code: Select all