TSmartQuery [Get RecCount]

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
renez
Posts: 6
Joined: Mon 18 Dec 2006 10:58

TSmartQuery [Get RecCount]

Post by renez » Thu 06 Dec 2007 12:13

Hello!

Is there an other possibility to call GetRecCount, than the property Options.QueryRecCount?

Thanks.

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

Post by Plash » Mon 10 Dec 2007 08:48

You can manually execute query to get record count:

Code: Select all

OraQuery2.SQL.Text := 'SELECT count(*) FROM (' + OraQuery1.SQL.Text + ')';
OraQuery2.Open;

renez
Posts: 6
Joined: Mon 18 Dec 2006 10:58

Post by renez » Mon 10 Dec 2007 09:35

Thanks for your answer.
My problem is, that we have a program which is coded by a outside company and i cannot find the part where GetRecCount is called. QueryRecCount is false and there is no count(*) in the code. But when i start the program, i can always see GetRecCount in the debug window. The count(*) needs roundabout 30 seconds, because of very much data in the table. So it takes a long time till the program is open to use.
Therefore i ask, if there is an another way to call GetRecCount.

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

Post by Plash » Mon 10 Dec 2007 11:55

There is no another way to call GetRecCount.

renez
Posts: 6
Joined: Mon 18 Dec 2006 10:58

Post by renez » Mon 10 Dec 2007 11:58

OK, thanks.

[email protected]
Posts: 10
Joined: Thu 08 Nov 2007 14:41

Post by [email protected] » Thu 13 Dec 2007 10:26

Code: Select all

Select count(0) from ....
is much faster that count(*)

jfudickar
Posts: 202
Joined: Fri 10 Mar 2006 13:03
Location: Oberursel / Germany

Post by jfudickar » Thu 13 Dec 2007 10:46

I use

Code: Select all

select count(1)
8) :lol:

But prinziple you are right !

Greetings
Jens

Post Reply