Subject | is table empty? |
---|---|
Author | Fred Pratt |
Post date | 2003-05-12T15:43:28Z |
I am converting a database from Informix to Firebird. So far, I have found
Firebird to be quite up to the task and am very impressed with its maturity,
performance, and reliability. I do have a question: Informix keeps row
count information in its table control structures so "select count(*) from
table" is instantaneous even if the table contains a billion rows. It
appears that Firebird actually counts the rows. In my app this query is
often used to determined if a table is empty, so I suppose I could write a
stored procedure that opens a cursor, does a fetch, and returns a yes/no for
table "emptiness". Is there a more elegant way to determine if a table is
empty in Firebird?
TIA,
Fred
--
-------------------------------------
Regards,
Fred Pratt
MicroBeef Technologies
PO Box 9262
Amarillo, TX 79105
phone 806 372 2369
fax 806 378 5556
email prattf@...
url http://www.microbeef.com
"Open the pod bay door please, HAL."
Firebird to be quite up to the task and am very impressed with its maturity,
performance, and reliability. I do have a question: Informix keeps row
count information in its table control structures so "select count(*) from
table" is instantaneous even if the table contains a billion rows. It
appears that Firebird actually counts the rows. In my app this query is
often used to determined if a table is empty, so I suppose I could write a
stored procedure that opens a cursor, does a fetch, and returns a yes/no for
table "emptiness". Is there a more elegant way to determine if a table is
empty in Firebird?
TIA,
Fred
--
-------------------------------------
Regards,
Fred Pratt
MicroBeef Technologies
PO Box 9262
Amarillo, TX 79105
phone 806 372 2369
fax 806 378 5556
email prattf@...
url http://www.microbeef.com
"Open the pod bay door please, HAL."