[Zope] Something funny about SQL like?

Martijn Pieters mj@antraciet.nl
Tue, 03 Aug 1999 10:32:39 +0200


At 23:50 02/08/99 , Donald Holten wrote:
>         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

Nope. Like is not supported by Gadfly. The 'expects' list doesn't contain 
it, which could have been a clue =).

--
Martijn Pieters, Web Developer
| Antraciet http://www.antraciet.nl
| Tel: +31-35-7502100 Fax: +31-35-7502111
| mailto:mj@antraciet.nl http://www.antraciet.nl/~mj
| PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149
------------------------------------------