Page 1 of 1

TSmartQuery [Get RecCount]

Posted: Thu 06 Dec 2007 12:13
by renez
Hello!

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

Thanks.

Posted: Mon 10 Dec 2007 08:48
by Plash
You can manually execute query to get record count:

Code: Select all

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

Posted: Mon 10 Dec 2007 09:35
by renez
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.

Posted: Mon 10 Dec 2007 11:55
by Plash
There is no another way to call GetRecCount.

Posted: Mon 10 Dec 2007 11:58
by renez
OK, thanks.

Posted: Thu 13 Dec 2007 10:26

Code: Select all

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

Posted: Thu 13 Dec 2007 10:46
by jfudickar
I use

Code: Select all

select count(1)
8) :lol:

But prinziple you are right !

Greetings
Jens