I have some trouble to implement such logic that after TOraStoredProc fetches new rows, all that new data is also saved elsewhere instead only showing in dbgrid.
In other words, when scrolling down on dbgrid then after every 25 (FetchRows count) rows new data is fetched but those rows must be available for another processing.
I cannot find procedure like OnFetch or AfterFetch, so how to detect fetch event and then get content?
Then after, do i need to scroll all rows after every fetch to get last fetched row or is there some smarter possibility like getting that data simultaneously when actually fetching? One thought is to somehow divide datasource to two components - dbgrid and some other. Dbgrid should be primary and second component should only mirror those rows but not fetch or change active row on dbgrid when doing its own processing.
Also the process should not interfere dbgrid navigation and with minimal performance hit as the fetched row count can get over 1000.
Maybe i overlooked something but hope to get some ideas..
Get all newly fetched records on fetch
Hello,
There is no AfterFetch event in the TOraStoredProc class, but it is available in its ancestor. That's why you can create a TOraStoredProc successor and move this event to the Public section.
Here is a small sample:
We will consider possibility to add this event to the ToraStoredProc in one of the next versions.
There is no AfterFetch event in the TOraStoredProc class, but it is available in its ancestor. That's why you can create a TOraStoredProc successor and move this event to the Public section.
Here is a small sample:
Code: Select all
TMyOraStoredProc= class(TOraStoredProc)
public
property AfterFetch;
end;
....
MyOraStoredProc := TMyOraStoredProc.Create(nil);
MyOraStoredProc.Session := OraSession1;
MyOraStoredProc.AfterFetch := MyOraStoredProcAfterFetch;
MyOraStoredProc.StoredProcName := 'get_cur';
OraDataSource1.DataSet:= MyOraStoredProc;
MyOraStoredProc.Open;
...
procedure TForm1.MyOraStoredProcAfterFetch(DataSet: TCustomDADataSet);
begin
ShowMessage('Fetched');
end;