Subject Re: [ib-support] is table empty?
Author Paolo Fainelli
try this:


IF (EXISTS (Select * from MyTable)) THEN ...

some days ago i read something about this question .... check other messages
in ib support
Bye


Paolo Fainelli


----- Original Message -----
From: "Fred Pratt" <prattf@...>
To: <ib-support@yahoogroups.com>
Sent: Monday, May 12, 2003 5:43 PM
Subject: [ib-support] is table empty?


> 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."
>