Subject Re: [IBO] Another parameter example
Author Jason Wharton
Yes, this is exactly correct. I can only combine parameters if their data
type is able to be merged buffer-wise (so to speak). I really should clear
up this potential ambiguity and either raise an exception or make it figure
out how to reconsile differing data types.

I've added this to my list of items to resolve in a future sub-release.

Regards,
Jason Wharton

----- Original Message -----
From: "Paul Vinkenoog" <paul@...>
To: <IBObjects@yahoogroups.com>
Sent: Tuesday, August 05, 2003 7:37 AM
Subject: Re: [IBO] Another parameter example


> 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