Subject | Re: [IBO] Another parameter example |
---|---|
Author | Paul Hope |
Post date | 2003-08-06T10:50:29Z |
Hi Paul
and it made no difference.
Thanks anyway
Regards
Paul
>That doesn't help - the data types are the same already, I tried it anyway
> > 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.
>
>
and it made no difference.
Thanks anyway
Regards
Paul