Subject Re: [IBO] Problems with TIBOQuery.Params
Author fabiano@leonilda.com.br
And what is the problem with this?

select ...
where ( :name like '*' or name like :name )

Now it returns just on parameter (vartext(50)), but when i put a
value on it (with more than one character) and open the query it
raises an exception.

... Isn't there some way of the parameters always assume the datatype
assigned manually, don't overriding them?

--- In IBObjects@y..., "Jason Wharton" <jwharton@i...> wrote:
> This is a feature of InterBase itself.
> You need to find a different solution.
> I recommend you look into using the SQLWhereItems and OnPrepareSQL
event.
> See the tech info sheet on this or search the archives.
>
> Jason Wharton
> CPS - Mesa AZ
> http://www.ibobjects.com
>
>
> ----- Original Message -----
> From: "Fabiano Di Grazia Bonin" <fabiano@l...>
> To: <IBObjects@y...>
> Sent: Friday, August 24, 2001 9:57 AM
> Subject: [IBO] Problems with TIBOQuery.Params
>
>
> > I'm using a TIBOQuery in a form with the following statement:
> >
> > select *
> > from cad1
> > where ( :name = '*' or cad1.name like '%' || :name || '%' )
> >
> > I want that, when the parameter = '*', it shows all records, and
when
> > the parameter is another thing, it filter the records.
> >
> > I noticed that when I prepared the query, IBO creates two params
> > called 'name', one type text(1) and the other type vartext(50)
> >
> > When I assign the value to the parameter (IBOQuery1.ParamByName
> > ('name').AsString := 'test' ), then value of the first parameter
> > is 't', and the value of the second parameter is not 'test', but
some
> > unreadable characters.
> >
> > What's the problem with this?