Subject Re: [ib-support] Re: BUG IN FIREBIRD
Author Artur Anjos
IF( DIVISAO1 IS NULL) THEN
select DIVISAO1,DIVISAO2 from AREA where DIVISAO1 IS NULL;
ELSE
select DIVISAO1,DIVISAO2 from AREA where DIVISAO1 = :DIVISAO1;

done.

----- Original Message -----
From: <banzatto@...>
To: <ib-support@yahoogroups.com>
Sent: Wednesday, October 17, 2001 4:58 PM
Subject: [ib-support] Re: BUG IN FIREBIRD


> Sorry by BUG and thanks, the solution this OK, but now i have another
> problem, whell :
>
> How do i make for check if a parameter is null ???
> ex :
>
> select DIVISAO1,DIVISAO2 from AREA where
> (DIVISAO1 = :DIVISAO1) OR (DIVISAO1 IS NULL AND :DIVISAO1 IS NULL)
>
>
>
>
>
> --- In ib-support@y..., "Ann W. Harrison" <aharrison@i...> wrote:
> > banzatto@c... wrote:
> >
> > >CREATE TRIGGER AREA_BI0 FOR AREA
> > >...
> > > > > WHERE (A.DIVISAO1 = NEW.DIVISAO1)
> > > > > AND (A.DIVISAO2 = NEW.DIVISAO2)
> > > > > AND (A.DIVISAO3 = NEW.DIVISAO3)
> > > > > AND (A.DIVISAO4 = NEW.DIVISAO4)))
> > > > > THEN
> > > > > EXCEPTION CHAVE_DUPLICADA;
> > >
> > >The fields DIVISAO1, DIVISAO2, DIVISAO3, DIVISAO4 cannot have to be
> > >duplicate, but they can have null values , therefore the use of
> > >trigger. Only that to trigger she does not function. Why ?
> >
> > If one of those fields has a null value in either table, then your
> > boolean expression evaluates to false. To make this work, you'll
> > need to add code to handle the null case.
> >
> > >CREATE TRIGGER AREA_BI0 FOR AREA
> > >...
> > > > > WHERE (A.DIVISAO1 = NEW.DIVISAO1
> > OR A.DIVISAO1 IS NULL AND NEW.DIVISAO1 IS
> > NULL)
> > > > > AND (A.DIVISAO2 = NEW.DIVISAO2
> > OR A.DIVISAO2 IS NULL AND NEW.DIVISAO2 IS
> > NULL)
> > > > > AND (A.DIVISAO3 = NEW.DIVISAO3
> > OR A.DIVISAO3 IS NULL AND NEW.DIVISAO3 IS
> > NULL)
> > > > > AND (A.DIVISAO4 = NEW.DIVISAO4
> > OR A.DIVISAO4 IS NULL AND NEW.DIVISAO4 IS
> > NULL)))
> > > > > THEN
> > > > > EXCEPTION CHAVE_DUPLICADA;
> >
> >
> > Regards,
> >
> > Ann
> > www.ibphoenix.com
> > We have answers.
> >
> >
> > Please, next time, don't shout bug until you're more certain you've
> got a bug.
> > It upset me.
>
>
>
> 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/
>
>