Subject Re: [IBO] Urgent - Bug in IBO Parameters ?
Author Nando Dessena
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