Long snapshot and 'next'

I have table with 200 000 records in it. When I open the 'select' statement in TOracleDataSet and execute 'Last' command then after long time waiting the exception with 'Out of memory' message appears. What to do?
 
For batch operations that process 200,000 records you should use the TOracleQuery. The TOracleDataSet was not designed to process these amounts of records.

If, however, you really want the "last" record, you should use a query that returns just that record.

------------------
Marco Kalter
Allround Automations
 
I can't use TOracleQuery 'cos I use TDBGrid and command 'Last' executed when I scroll to last record in TDBGrid. How can I scroll in big result sets in both directions (up and down)?
 
You can scroll in both directions, but scrolling to the 'last' record may cause memory problems. If it is just the last record(s) you are interested in, just sort the result set by using an appropriate order by clause.

If you need both the first and last records of a 200,000 record result set, then it may be a good idea to rethink this functionality. Why is the first and the last record of a 200,000 record result set important? Can they be queried in a more efficient way? How, for example, would you solve this in PL/SQL on the server?

------------------
Marco Kalter
Allround Automations
 
I see. But visual grid in Oracle Forms can scroll result set of any size in both directions without any restriction. I think that fetched data is swapped to local disk and in memory remains only fixed number of records. It's good idea for writing new component in DOA. For example, TVirtualOracleDataSet.
 
Back
Top