Subject | Problems with TIBOQuery.Params |
---|---|
Author | Fabiano Di Grazia Bonin |
Post date | 2001-08-24T16:57:42Z |
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?
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?