Board index » delphi » Help - Stuck With 20 Records Per SQL Fetch ?????

Help - Stuck With 20 Records Per SQL Fetch ?????

Help!!!!

We are using a remote Oracle7 database and in all of our TQuery and
TTable components, we have found that Delphi 2.0 seems to only retrieve
20 records at a time (even if we use the FetchAll method). This means
that if we want to retrieve 200 records, Delphi seems to issue about 20
separate calls to our SQL database!

We know this, 1) by watching the mouse cursor change to the "SQL"
hourglass while we scroll down in a DBGrid, 2) by looking at the multiple
fetch commands issued in the SQL Monitor log, 3) by checking the hits to
the Oracle RDBMS on our server, and 4) by how slow Delphi is when
bringing a bunch of records (constrained or not) into client memory.

We have tried setting the SQLQRYMODE explicitly to SERVER, experimenting
with the DBE object properties (especially curMAXROWS), and by
experimenting with different record and table sizes.  Nothing seems to
change the 20 records per fetch behavior.  Even the Database Explorer has
this limitation.  We have looked through all of the code in BD.pas and
BDtables.pas and have written BDE equivalents for TQuery to see if we
could fix this.  Everything seems to be internal to the DbiQExec or
DbiQExecDirect functions for TQueries and to DBI cursor behavior for
TTables.  No answers from DbiGetProp have shed any light.

We have seen, however, a mysterious call as reported in SQL Monitor "SQL
Misc: ORACLE - Set rowset size".  Could this be telling the BDE to bring
back only 20 at a time?  In contrast, Powerbuilder, as inelegant as it
is, beautifully sends a single fetch and retrieves all necessary records
into its buffer in a single sweep.

Please help.  We are getting desperate and incredulous over what we
consider is, hopefully, the result of our own stupidity and oversight.

Thank you in advance for your much needed help.

 Jeff K
 Hillside, NJ
 email: je...@panix.com

 

Re:Help - Stuck With 20 Records Per SQL Fetch ?????


Quote
jeff <je...@panix.com> wrote:
>Help!!!!
>We know this, 1) by watching the mouse cursor change to the "SQL"
>hourglass while we scroll down in a DBGrid,

The DBGrid is specifically designed to only display enough data to
fill a page of the grid.  The reason for this is simple.  What if you
had a table with 1 million rows.  Where on earth would you store the
data if 1 million rows were returned from a query?  How long would the
user have to wait for it to come back?  I love the DBGrid.

Quote
>In contrast, Powerbuilder, as inelegant as it
>is, beautifully sends a single fetch and retrieves all necessary records
>into its buffer in a single sweep.

You mean PB actaully returns every row in one fell swoop?  Where does
it put them if you don't have a 10 meg buffer to store your 10 meg
database?
-------------------------------
Thomas Paul
TOMG...@Pipeline.Com
Dean Witter, Discover & Co.
New York City, NY USA
----------------------------------

Re:Help - Stuck With 20 Records Per SQL Fetch ?????


Quote
Thomas Paul wrote:

>>Help!!!!

>>We know this, 1) by watching the mouse cursor change to the "SQL"
>>hourglass while we scroll down in a DBGrid,

>The DBGrid is specifically designed to only display enough data to
>fill a page of the grid.  The reason for this is simple.  What if you
>had a table with 1 million rows.  Where on earth would you store the
>data if 1 million rows were returned from a query?  How long would the
>user have to wait for it to come back?  I love the DBGrid.
>>In contrast, Powerbuilder, as inelegant as it
>>is, beautifully sends a single fetch and retrieves all necessary records
>>into its buffer in a single sweep.

>You mean PB actaully returns every row in one fell swoop?  Where does
>it put them if you don't have a 10 meg buffer to store your 10 meg
>database?

  I left one of our customers' places yesterday with a PB 4.0 app doing
exactly that.  It had sucked the RAM out of the machine retrieving the
first 420,000 rows, and had failed to write the results to any of the 1GB
available on the hard disk.

  The IS staff person in charge had left already, so we let the PB 4.0 app
run overnight to show him when he gets in Friday morning.  I was expecting
the result set to be > 4 million rows, so the app will still be chugging
away.  This is on a one month-old Gateway P133 with 32 MB RAM running
Win95, where the database being queried is on the local CD drive.

Paul Rice

Other Threads