Python Multiline
Hi,
I want to submit multiline statements using Python (eg statements seperated by semicolons) but am having trouble doing so. For instance, if I do
db = MySQLdb.connect(host="x.org", user="usr", passwd="pwd", db="db", client_flag=MySQLdb.constants.CLIENT.MULTI_STATEMENTS|MySQLdb.constants.CLIENT.MULTI_RESULTS)
cursor = db.getCursor()
cursor.execute("INSERT INTO x (foo) VALUES ('1');INSERT INTO x (foo) VALUES ('3')")
The last line will fail. Any idea how to fix this?
-YG
Subject
Written By
Posted
Python Multiline
July 16, 2007 07:45PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.