Subject Re: something like delphi's 'isempty' ref/eDN6052838979
Author Adam
--- In firebird-support@yahoogroups.com, "Dennis" <dennis@...> wrote:
>
> Deal all.
>
>
>
> I want to ask the base with a query and to return me if there is a
least on
> record with specific criteria.
>
>
>
> Using

Usually if I need this I just do a select 'first 1' because the
logical next step is what is the first record. If you just want a
yes/no, then the following is one way.

select
case when exists (select code_a from sales where partno='2323') then
'T' else 'F' end as IsThereAtLeast1Record
from RDB$DATABASE;

or inside a stored procedure or trigger block:

if (exists (select .....)) then
begin

end
else
begin

end


Adam