Re: [pysqlite] [3.6.3-r1] Row not updated?
Adrian Klaver <[email protected]> Thu, 20 Nov 2008 07:00:06 -0800
| Newsgroups | gmane.comp.python.db.pysqlite.user |
|---|---|
| Message-ID | <[email protected]> |
On Thursday 20 November 2008 5:50:08 am Fred wrote:
> Yet more information : closing/reopening a cursor doesn't solve the
> issue either :-/
>
> =========
> sql = "BEGIN; UPDATE ape SET nombre=%s WHERE code='%s'; END" %
> (m.group(1),ape) print sql
> cursor = None
> cursor=connection.cursor()
> cursor.execute(sql)
>
> sql = "SELECT nombre FROM ape WHERE code='%s'" % ape
> #Displayed OK, but UPDATE gone when reopening the database with sqlite3.exe
> print sql
> cursor = None
> cursor=connection.cursor()
> row=cursor.execute(sql)
> for item in row:
> print "Nombre=%s" % item[0]
>
> cursor = None
> cursor=connection.cursor()
> cursor.execute("BEGIN")
Eliminate this ^^^^^^^^
> for match in matches:
> sql = 'INSERT INTO boites (code,siren) VALUES ("%s","%s")' %
> (ape,lastsiren) cursor.execute(sql)
> cursor.execute("END")
And this ^^^^^^^
Do instead connection.commit()
> =========
>
> Thank you.
>
> _______________________________________________
> list-pysqlite mailing list
> list-pysqlite-FR6EJeJVuqdwc357pe9rcyQmJico6nz3epZhswDD4dQ@public.gmane.org
> http://itsystementwicklung.de/cgi-bin/mailman/listinfo/list-pysqlite
--
Adrian Klaver
[email protected]