Re: sqlite single transaction without foreign key or triggers

2009-05-13 Thread John Machin
On 14/05/2009 8:21 AM, Rob Williscroft wrote in private e-mail (presumably by mistake): On 13 May 2009, you wrote in comp.lang.python: On May 13, 11:46燼m, a...@pythoncraft.com (Aahz) wrote: In article , Rob Williscroft wrote: Aahz wrote innews:guao50$1j...@panix3.panix.comin comp.lang.py

Re: sqlite single transaction without foreign key or triggers

2009-05-13 Thread Rob Williscroft
John Machin wrote in news:b722bd36-c8f1-4cdf-8625-2550cee21511 @i28g2000prd.googlegroups.com in comp.lang.python: > On May 13, 11:46 am, a...@pythoncraft.com (Aahz) wrote: >> In article , >> Rob Williscroft   wrote: >> >> >> >> >Aahz wrote innews:guao50$1j...@panix3.panix.comin comp.lang.python: >

Re: sqlite single transaction without foreign key or triggers

2009-05-12 Thread John Machin
On May 13, 11:46 am, a...@pythoncraft.com (Aahz) wrote: > In article , > Rob Williscroft   wrote: > > > > >Aahz wrote innews:guao50$1j...@panix3.panix.comin comp.lang.python: > >> In article , > >> Rob Williscroft   wrote: > > >>>db.execute( ''' > >>>         update "sessions" set "uid" = ? > >>>  

Re: sqlite single transaction without foreign key or triggers

2009-05-12 Thread Aahz
In article , Rob Williscroft wrote: >Aahz wrote in news:guao50$1j...@panix3.panix.com in comp.lang.python: >> In article , >> Rob Williscroft wrote: >>> >>>db.execute( ''' >>> update "sessions" set "uid" = ? >>> where "uid" = ? >>> and exists( >>> selec

Re: sqlite single transaction without foreign key or triggers

2009-05-12 Thread Rob Williscroft
Aahz wrote in news:guao50$1j...@panix3.panix.com in comp.lang.python: > In article , > Rob Williscroft wrote: >> >>db.execute( ''' >> update "sessions" set "uid" = ? >> where "uid" = ? >> and exists( >> select * from "users" where "uid" = ? >>

Re: sqlite single transaction without foreign key or triggers

2009-05-11 Thread Aahz
In article , Rob Williscroft wrote: > >db.execute( ''' > update "sessions" set "uid" = ? > where "uid" = ? > and exists( > select * from "users" where "uid" = ? > ) >''', >(v['uid'],s.SID, v['uid']) > ) This will be more efficient if you do "sel

Re: sqlite single transaction without foreign key or triggers

2009-05-11 Thread gert
On 11 mei, 23:07, Rob Williscroft wrote: > gert wrote in news:d7591495-4661-4243-ad7e-f142d8244e88 > @e24g2000vbe.googlegroups.com in comp.lang.python: > > > I am trying to do this in a single transaction, the 3 separate > > statements work fine, but i am screwed if they are not executed > > toget

Re: sqlite single transaction without foreign key or triggers

2009-05-11 Thread Rob Williscroft
gert wrote in news:d7591495-4661-4243-ad7e-f142d8244e88 @e24g2000vbe.googlegroups.com in comp.lang.python: > I am trying to do this in a single transaction, the 3 separate > statements work fine, but i am screwed if they are not executed > together. Well you're in luck, Python DBAPI 2 connections

sqlite single transaction without foreign key or triggers

2009-05-11 Thread gert
I am trying to do this in a single transaction, the 3 separate statements work fine, but i am screwed if they are not executed together. ### db.execute('BEGIN') # db.execute('UPDATE users SET uid=? WHERE uid=?',(v['uid'],s.UID)) db.execute('UPDATE sessions SET uid=? WHERE si