Share

InformixDB

Tracker: Bugs

5 Update executes, but row not updated - ID: 2814092
Last Update: Comment added ( octopusgrabbus )

I have a simple update of a one row table. It works in Perl and 4GL, but
not this example. I am wondering what might be wrong with how I have
structured the example.


cmnorton ( octopusgrabbus ) - 2009-06-29 16:17

5

Closed

Rejected

Nobody/Anonymous

None

None

Public


Comments ( 2 )




Date: 2009-06-29 22:04
Sender: octopusgrabbus

Thanks for the feedback. I will make the adjustments.


Date: 2009-06-29 17:08
Sender: chaeseProject Admin

Python's DB-API specs dictate that connections operate in a transaction by
default. You need to explicitly commit the change by calling conn.commit(),
or open the connection in autocommit mode. You're doing neither, so the
update is implicitly rolled back when the script exits.

By the way, you're not closing the cursor. "cur.close" just looks up the
close method without calling it. You need "cur.close()" to call the method.
Also, the second "cur.close" should probably be "conn.close()".

Lastly, plugging variables into a query by string concatenation is really
bad style. Use parameter passing instead. See
http://informixdb.blogspot.com/2007/07/filling-in-blanks.html for details.


Log in to comment.

Attached File ( 1 )

Filename Description Download
setIcsFyEx.py Example that won't update Download

Changes ( 4 )

Field Old Value Date By
status_id Open 2009-06-29 17:08 chaese
resolution_id None 2009-06-29 17:08 chaese
close_date - 2009-06-29 17:08 chaese
File Added 332806: setIcsFyEx.py 2009-06-29 16:17 octopusgrabbus