MySQLdb UPDATE does nothing

Rowdy david at fielden.com.au
Thu Sep 15 08:27:51 EDT 2005


John Moore wrote:
> Hi,
> 
> I normally work with Java but I'm interested in using Python as well, 
> particularly for little tasks like doing some massaging of data in a 
> MySQL database. Below is my first attempt. I'm sure it's inelegantly 
> written, but my main concern is that the UPDATE sql doesn't actually 
> work, and I can't understand why. No error is returned, it's just that 
> the update does not take place. The SQL itself is fine, though - if I 
> instead write the SQL to a file I can use it from the mysql command line 
> and it does all the updates just fine. What have I missed?
> 
> John
> 
<snip>

A similar question was asked back in July, someone posted this:

<quote>
If it's any help, using

      cursor.execute("set autocommit = 1")

before doing anything else works nicely unless you actually need
transactions.
</quote>

Rowdy



More information about the Python-list mailing list