Subject | Re: [ib-support] is table empty? |
---|---|
Author | Fred Pratt |
Post date | 2003-05-12T16:11:01Z |
Thanks to all for the help!! I will check previous threads before asking a
question in the future. Long weekend - not thinking clearly yet.
Fred
question in the future. Long weekend - not thinking clearly yet.
Fred
On Monday 12 May 2003 10:59, Christian Gütter wrote:
> Hi Fred,
>
> > Is there a more elegant way to determine
> >
> > if a table is empty in Firebird?
>
> In PSQL:
> IF (EXISTS(SELECT * FROM MyTable)) THEN ...
>
> In DSQL, you can use EXISTS in the WHERE clause:
> SELECT '1' FROM RDB$Database WHERE EXISTS(SELECT 1 FROM MyTable)
> If MyTable is empty, this statement returns NULL, otherwise
> it returns '1'. And this is very fast.
>
>
> HTH,
>
> Christian
>
>
>
>
> Yahoo! Groups Sponsor
>
>
>
>
>
> ADVERTISEMENT
>
>
>
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
--
-------------------------------------
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."