Subject Re: [ib-support] Re: Greetings, and, Fire!
Author Svein Erling Tysvær
Edson:

>1) It works :
> XXX.SQL.Text := 'select * from Table where ',Value1,Value2,Value3,' LIKE
>'%,' || StringField || ',%''
> XXX.Open;

This works because everything is known at prepare time (before opening the
query).

>2) It not works:
> 'select * from Table where :Param LIKE '%,' || StringField ||',%''
> XXX.Params[0].AsString := ',Value1,Value2,Value3,';
> XXX.Open;

This doesn't work because the datatype of :Param is unknown at prepare time
(before assigning parameter).

I don't think there is any way you can make a parameter work on the 'left
side' of a comparison. I.e.

SELECT * FROM <Table>
WHERE :PARAM <Operator> <Value>

will never work, whereas

SELECT * FROM <Table>
WHERE <Field> <Operator> :PARAM

does work. I think <Field> could possibly be a value (though I'm not
certain), but then you might have to cast it.

Set