Subject Re: [ib-support] How can I check if a table is empty?
Author Arno Brinkman
Hi,

> Isn't SELECT * returns everything, and when applied to large table,
> introduce much overheads ?

No, if at least one match is found it returns from the EXISTS(), so EXISTS()
is the right way to go in SP's and Triggers.

Regards,
Arno Brinkman
ABVisie

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Firebird links :
http://www.firebirdsql.com
http://www.firebirdsql.info
http://www.fingerbird.de/
http://www.comunidade-firebird.org/


Nederlandse firebird nieuwsgroep :
news://80.126.130.81


> Pls correct me if I'm wrong. I always think this is the case.
>
> Albert.
>
> Dimitry Sibiryakov wrote:
> > On 5 May 2003 at 15:00, mcrosman1957 wrote:
> >
> >
> >>I am developing a store procedure and a trigger in which I need to
> >>check if a table is empty or not.
> >
> >
> > IF (EXISTS (Select * from MyTable)) THEN ...
> >
> > SY, Dimitry Sibiryakov.