Hi is it the intention that ZSQLMethods could contain more than one SQL statement? eg (ridiculous example I know) insert into foo values('bar'); delete from foo obviously in the case of query, you only get the last result set. The reason I ask, is that this currently doesnt work with ZMySQLDA 2.08 / MySQLdb 0.9.1 This seems to be because in the mysql client the call to mysql_real_query c function is only expected to take one SQL statement. Of course the code above works correctly in the mysql interactive prompt. If the ZSQLMethod is meant to take multiple statements then I'd better look at fixing it. What do the other DA products do? Thanks Jon
Hi, In ZSQL Methods, the statement must be separated by <dtml-var sql_delimiter> Strange but that's the rule. HTH --Gilles ----- Original Message ----- From: "Jon Dyte" <jon@totient.demon.co.uk> To: <zope@zope.org> Sent: Thursday, February 14, 2002 12:00 AM Subject: [Zope] ZSQL Methods and multiple SQL statements
Hi
is it the intention that ZSQLMethods could contain more than one SQL statement?
eg (ridiculous example I know)
insert into foo values('bar'); delete from foo
obviously in the case of query, you only get the last result set.
The reason I ask, is that this currently doesnt work with ZMySQLDA 2.08 / MySQLdb 0.9.1
This seems to be because in the mysql client the call to mysql_real_query c function is only expected to take one SQL statement. Of course the code above works correctly in the mysql interactive prompt.
If the ZSQLMethod is meant to take multiple statements then I'd better look at fixing it.
What do the other DA products do?
Thanks
Jon
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
On Wednesday 13 February 2002 03:00 pm, Jon Dyte wrote:
Hi
is it the intention that ZSQLMethods could contain more than one SQL statement?
eg (ridiculous example I know)
insert into foo values('bar'); delete from foo
try using the <dtml-var sql_delimiter> syntax between statements. one restriction, you can't do multiple select statements. this is covered in the documentation. hth kapil
participants (3)
-
Gilles Lenfant -
Jon Dyte -
kapil thangavelu