Page 1 of 1

TUniTable.RecordCound = 25 ???

Posted: Wed 17 Jun 2009 09:31
by invent
Hello,

I have another problem. Please take a look at these lines:

UniConnection1.GetTableNames (StringList1, false);
for i := 0 to StringList1.Count - 1 do
begin
UniTable1.TableName := StringList1.Strings ;
UniTable1.Open;
StringGrid1.Cells [1, i] := IntToStr (UniTable1.RecordCount);
UniTable1.Close;
end;

For every table with more than 24 records is UniTable1.RecordCount = 25.

I tried this with UniDAC for Delphi 7 Version 2.70.0.8 (27-May-2009) and InterBase 2007 or Oracle 8.05.

Is this a bug or is there any parameter to set?

FYI: TUnIQuery and 'select count(*) from ' works fine.

Thanks in advance,
Gerd Brinkmann
invent GmbH

Posted: Wed 17 Jun 2009 12:17
by tobias_cd
Hallo Gerd,

in your Unidac help search for "FetchRows", "QueryRecCount" and "SpecificOptions" topics.

Example 1 (only for Oracle):
MyUniQuery.SpecificOptions.Add('Oracle.FetchAll=False');
Example 2 (for all RDBMS):
MyUniQuery.SpecificOptions.Add('FetchAll=True');

The "QueryRecCount" does have a performance impact, so it should only be used if really needed.

Posted: Wed 17 Jun 2009 13:34
by invent
Hello Tobias,

thank you for this information. My Problem is in the UniTable, not in UniQuery.

With your hint i learned, that there is a property 'FetchRows' in TUniTable, which is by default = 25, so every UniTable.RecordCount gives 25.

Setting the SpecificOption 'FetchAll = true' is no good idea, because it's only useful by small tables.

Okay, the problem is solved. I replaced all 'Table.RecordCount' with 'select count(*)'.

Thanks,
Gerd Brinkmann
invent GmbH

Posted: Thu 18 Jun 2009 06:26
by Plash
If you set the QueryRecCount option to True, TUniTable executes SELECT COUNT() query automatically when you open the table, and assigns the correct value to the RecordCount property.

Posted: Thu 18 Jun 2009 11:41
by invent
Thanks a lot. I have to migrate a big project from BDE to UniDAC and I have to learn many new parameters. So I have a few simple questions...
Kind regards,
Gerd Brinkmann
invent GmbH