Subject RE: [ib-support] How can I check if a table is empty?
Author PODESTA Mariano APRE
ikka:

you can use a procedure like:

create procedure do_mytable_isempty
returns (result smallint)
as
begin

if (exists (select * from mytable)) then
result = 1;
else
result = 0;

end

> -----Original Message-----
> From: PUB: Ikka Vertika (DTC) [mailto:Ika@...]
> Sent: MiƩrcoles, 07 de Mayo (5) del 2003 0:34
> To: ib-support@yahoogroups.com
> Subject: Re: [ib-support] How can I check if a table is empty?
>
>
> How about :
>
> "IBTable.IsEmpty"
>
> Can we use that function to check if a table is empty ?
>
>
> --> IBTable : TIBTable (from IBX Palete)
>
>
> Thank you,
>
>
> Ikka Vertika
> jakarta - indonesia
>
>
> ----- Original Message -----
> From: "Helen Borrie" <helebor@...>
> To: <ib-support@yahoogroups.com>
> Sent: Wednesday, May 07, 2003 09:18 AM
> Subject: Re: Spam Alert: Re: [ib-support] How can I check if
> a table is empty?
>
>
> | >How would you use that in Delphi with IBX?
> |
> | It's a PSQL construct so - by calling a stored procedure
> that uses it.
> |
> | You can do the EXISTS() test in DSQL inside a WHERE clause, e.g.
> | SELECT.....
> |
> | WHERE EXISTS(SELECT 1 FROM MyTable)
> |
> | So to test whether MyTable is empty you could just create a
> bare DSQL
> | select statement that returns something, e.g
> | select '1' from rdb$database where exists(select 1 from MyTable)
> |
> | heLen
> |
>
>
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~-->
> Make Money Online Auctions! Make $500.00 or We Will Give You
> Thirty Dollars for Trying!
> http://us.click.yahoo.com/KXUxcA/fNtFAA/uetFAA/67folB/TM
> --------------------------------------------------------------
> -------~->
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>