[Zope] Something funny about SQL like?
Donald Holten
donner@biophysics.lanl.gov
Mon, 2 Aug 1999 15:50:39 -0600 (MDT)
Well, I've tried escaping the '%', single quotes instead of double quotes, sqlvar instead of var, and
none of those have worked. Here's the code again:
select *
from Users
where <!--#var searchkey--> like "%<!--#var valuekey-->%"
order by <!--#var searchkey-->
And here's the error again:
Error, exceptions.SyntaxError: unexpected token sequence.near :: 'where
firstname'*' like "%Donald%'
******************************* current state = 45 expects: ',', 'UNION',
'FLOAT', 'GROUP',
'VARCHAR', 'DESC', 'SELECT', 'ORDER', 'WHERE', 'AS', 'IN', 'INTERSECT', 'ASC',
'*', '+', '(', ')', '.',
'/', 'EXCEPT', '-', 'AND', 'FROM', '*', ';', 'INTEGER', 'NOT', '>', 'OR', '=',
'BETWEEN', 'HAVING', '<',
'VALUES', ('nomatch1',) current token = ((-8, 'user_defined_name'), 'LIKE')
SQL used:
select *
from Users
where firstname like "%Donald%"
order by firstname
Like I said, it looks to me like the SQL it's trying to use is fine.
Does GadflySQL not support the "like" keyword?
Donner