Magnus Lycka wrote:
> Steve Horsley wrote:
>> Or, as I found out yesterday, cursor.execute('commit') afterwards.
>
> The correct way to do it is to close the cursor object, and
> then do "db.commit()". Don't rely on a cursor object to work
> across transaction boundries!
>
> See e.g. www.thinkwar
Steve Horsley wrote:
> Or, as I found out yesterday, cursor.execute('commit') afterwards.
The correct way to do it is to close the cursor object, and
then do "db.commit()". Don't rely on a cursor object to work
across transaction boundries!
See e.g. www.thinkware.se/epc2004db/epc04_mly_db.pdf and
Rowdy wrote:
>> A similar question was asked back in July, someone posted this:
>
>
> If it's any help, using
>
> cursor.execute("set autocommit = 1")
>
> before doing anything else works nicely unless you actually need
> transactions.
>
Or, as I found out yesterday, cursor.execute('comm
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 d
On 9/15/05, John Moore <[EMAIL PROTECTED]> wrote:
> I tried that, but got this:
>
> Traceback (most recent call last):
> File "moddb.py", line 31, in ?
> cursor.commit()
> AttributeError: 'Cursor' object has no attribute 'commit'
Oops. I should have said connection.commit(). Posting before
>> sql="UPDATE product_attribute SET index_column = "+str(index)+" WHERE id =
>> "+str(record2[0])
>> ..
>> cursor.execute(sql)
To allow the DB-API adaptor to correctly take care of value conversion
and SQL escaping for you, this should be written as:
cursor.execute("UPDATE product_attribute SET
On 9/15/05, John Moore <[EMAIL PROTECTED]> wrote:
> ... my main concern is that the UPDATE sql doesn't actually
> work, and I can't understand why.
You probable need to commit your changes. Try a cursor.commit() call.
If all the changes make up one logical transaction, do the commit at
the end of
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 c