[Zope-DB] subqueries from ZSQL method?

Ole J. Tennvassås olejt at tiscali.no
Mon Sep 6 16:23:57 EDT 2004


I'm trying to run this SQL statement:
"SELECT s1 FROM t1 WHERE s1 NOT IN (SELECT s1 FROM t2 WHERE s2 =
<dtml-sqlvar s2 type="int">)",
but zope gives the error message:
Error, _mysql_exceptions.ProgrammingError: (1064, "You have an error in
your SQL syntax. Check the manual that corresponds to your MySQL server
version for the right syntax to use near 'SELECT s1 FROM t2 WHERE s2 =
2) LIMIT 1000")
What i want to do is list all values of s1 in table 1 which isnt found
in table 2 rows where s2  some dynamic value.
If i run the subquery only it works fine.
Any suggestions?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope-db/attachments/20040906/683a3c6a/attachment.htm


More information about the Zope-DB mailing list