Subject | Re: [firebird-support] Re: something like delphi's 'isempty' ref/eDN6052838979 |
---|---|
Author | Fernando Salaices |
Post date | 2006-10-16T17:04:48Z |
I was going to suggest EXISTS also, but several people beat me to it hehehe.
On 10/16/06, Adam <s3057043@...> wrote:
>
> --- In firebird-support@yahoogroups.com<firebird-support%40yahoogroups.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
>
>
>
--
Saludos,
Fernando Salaices.
[Non-text portions of this message have been removed]