TUniTable.RecordCound = 25 ???

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
invent
Posts: 92
Joined: Tue 16 Jun 2009 10:59
Location: Bielefeld, Germany

TUniTable.RecordCound = 25 ???

Post by invent » Wed 17 Jun 2009 09:31

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

tobias_cd
Posts: 56
Joined: Thu 18 Dec 2008 22:10

Post by tobias_cd » Wed 17 Jun 2009 12:17

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.

invent
Posts: 92
Joined: Tue 16 Jun 2009 10:59
Location: Bielefeld, Germany

Post by invent » Wed 17 Jun 2009 13:34

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

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Thu 18 Jun 2009 06:26

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.

invent
Posts: 92
Joined: Tue 16 Jun 2009 10:59
Location: Bielefeld, Germany

Post by invent » Thu 18 Jun 2009 11:41

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

Post Reply