Re: [pysqlite] [3.6.3-r1] Row not updated?

Fred <[email protected]> Thu, 20 Nov 2008 14:07:36 +0100
Newsgroups gmane.comp.python.db.pysqlite.user
Message-ID <[email protected]>
More information : Although the UPDATE seems 
successfully run since the following SELECT does 
return the correct updated value... but this 
UPDATE is lost when I re-open the database file using sqlite3.exe afterward.

Could it be that the INSERT statements that 
follow the UPDATE somehow supersede the previous UPDATE?

======
m = found.search(response)
if m:
	print "%s companies found" % m.group(1)
	sql = "BEGIN; UPDATE ape SET nombre=%s WHERE 
code='%s'; END" % (m.group(1),ape)
	print sql
	cursor.execute(sql)
	
	#UPDATE/SELECT successful... but UPDATE lost 
when re-opening using sqlite3.exe afterward?
	sql = "SELECT nombre FROM ape WHERE code='%s'" % ape
	print sql
	row=cursor.execute(sql)
	for id in row:
		#Displayed OK
		print "Nombre=%s" % id[0]
	
	
	company = re.compile('"\d+","\d+","(\d+)"')
	matches = company.finditer(response)
	cursor.execute("BEGIN")
	for match in matches:
		lastsiren = match.group(1)
		print "Found %s " % lastsiren
		#On garde dernier SIREN en mémoire pour vérifier si page suivante
		sql = 'INSERT INTO boites (code,siren) VALUES ("%s","%s")' % (ape,lastsiren)
		cursor.execute(sql)
	cursor.execute("END")
======

Puzzled,
Fred.