Subject | Re: [ib-support] Re: Greetings, and, Fire! |
---|---|
Author | Svein Erling Tysvær |
Post date | 2002-06-07T06:44:34Z |
Edson:
query).
(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
>1) It works :This works because everything is known at prepare time (before opening the
> XXX.SQL.Text := 'select * from Table where ',Value1,Value2,Value3,' LIKE
>'%,' || StringField || ',%''
> XXX.Open;
query).
>2) It not works:This doesn't work because the datatype of :Param is unknown at prepare time
> 'select * from Table where :Param LIKE '%,' || StringField ||',%''
> XXX.Params[0].AsString := ',Value1,Value2,Value3,';
> XXX.Open;
(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