Subject Re: [IBO] Another parameter example
Author Paul Vinkenoog
Hi Paul,

> I remember parameter problems with the new FB versions but dont
> remember any resolution to the occurring twice problem. I can get
> round this particular one by rewriting it to dynamic SQL. However I
> use multiple parameter occurrence a lot and it really needs to be
> resolved.

Maybe I have a clue after all! Look at what Markus Ostenried wrote as
a solution to another problem:

select *
from customer
where (type = :paramtype) or (Cast('*' as VarChar(3)) = :paramtype)
Note that you need to cast your constant value to the same field type
that you have defined your column with. Otherwise IBO will create a
second parameter of type Char(1).

As said: this was an unrelated problem, but the importance lies in
what he says about casts. If you have multiple occurences of a named
param, _and_ you cast, at every occurence, the field, constant, or
whatever you compare the param with, to the same datatype (unless it
already has that type explicitly), IBO creates only a single parameter
and your problem should be gone.


HTH,
Paul Vinkenoog