Subject Re: [IBO] Urgent - Bug in IBO Parameters ?
Author Jason Wharton
You can have a parameter twice if it resolves to the same data type and
length for both of them. If they are different I treat them separately.

Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com


----- Original Message -----
From: "Nando Dessena" <nandod@...>
To: <IBObjects@yahoogroups.com>
Sent: Friday, January 26, 2001 7:49 AM
Subject: Re: [IBO] Urgent - Bug in IBO Parameters ?


> Helen,
>
> > >SELECT * FROM CadPFJ
> > >WHERE (CodEmp = 1 AND CodPFJ BETWEEN :CodPFJ and :CodPFJ2 )
> > >AND ((TipPFJ = :TipPFJ ) or (*** :TipPFJ2 *** = 'ForCli' and TipPFJ in
> > >('Fornec', 'Client', 'ForCli')))
> > >ORDER BY CodPFJ
> > >
> > >Any suggestion?
> >
> > This statement is different - you now have two parameters. However, it
> > will not return the conditional result set you describe here:
> >
> > You said:
> > > what I really need is:
> > > If the parameter value is equal 'ForCli' I want that all records
equal at
> > > 'Fornec', 'Client', 'ForCli' be returned, but if the parameter value
is
> > > different I want just the records who are equal to the parameter
value to be
> > > returned.
> >
> > You need an SQL CASE statement but, unfortunately, InterBase doesn't yet
> > support it. In order to get a conditional set, you will need a
selectable
> > stored procedure.
>
> The SQL statement is fine, even if maybe not so common.
> The "wrong" thing in the previous version was that Paulo used the same
> parameter name twice.
> Wasn't there an open IBO bug with repeated parameter names? Or was it in
> union select statements only? I can't remember.
> --
> ____
> _/\/ando
>
>
>