Hi!
Is it possible to use parameter markers like this:
1.) SELECT * FROM TABLE1 WHERE FIELD1 LIKE '%?%'
If I now set parameter 1 to '' (empty string) I don't get any rows back,
but if I run:
2.) SELECT * FROM TABLE1 WHERE FIELD1 LIKE '%%'
I get back data I expect.
So what does the value of parameter marker has to be, so that the SQL
1.) behaves as 2.)?
I know I could do it like this:
SELECT * FROM TABLE1 WHERE FIELD1 LIKE ?
and set parameter to
'%%', but that is really not a solution, since we have a lot of SQLs
written like 1.) and we cannot just change them.
Best regards,
Kovi
--
_______________ _____________
|http://kovica.blogspot .com|
-----------------------------~-~-~-~-~-~-~-~-~-~-
| In A World Without Fences Who Needs Gates? |
| Experience Linux. |
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
Is it possible to use parameter markers like this:
1.) SELECT * FROM TABLE1 WHERE FIELD1 LIKE '%?%'
If I now set parameter 1 to '' (empty string) I don't get any rows back,
but if I run:
2.) SELECT * FROM TABLE1 WHERE FIELD1 LIKE '%%'
I get back data I expect.
So what does the value of parameter marker has to be, so that the SQL
1.) behaves as 2.)?
I know I could do it like this:
SELECT * FROM TABLE1 WHERE FIELD1 LIKE ?
and set parameter to
'%%', but that is really not a solution, since we have a lot of SQLs
written like 1.) and we cannot just change them.
Best regards,
Kovi
--
_______________ _____________
|http://kovica.blogspot .com|
-----------------------------~-~-~-~-~-~-~-~-~-~-
| In A World Without Fences Who Needs Gates? |
| Experience Linux. |
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
Comment