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 xns9c09513903e8frtwfreenetremovec...@216.196.109.145, Rob Williscroft  r...@freenet.co.uk wrote: Aahz wrote

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 xns9c09513903e8frtwfreenetremovec...@216.196.109.145, Rob Williscroft r...@freenet.co.uk

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 xns9c08e179b66d8rtwfreenetremovec...@216.196.109.145, Rob Williscroft r...@freenet.co.uk wrote: db.execute( ''' update sessions set uid = ? where uid = ? and exists(

Re: sqlite single transaction without foreign key or triggers

2009-05-12 Thread Aahz
In article xns9c09513903e8frtwfreenetremovec...@216.196.109.145, Rob Williscroft r...@freenet.co.uk wrote: Aahz wrote in news:guao50$1j...@panix3.panix.com in comp.lang.python: In article xns9c08e179b66d8rtwfreenetremovec...@216.196.109.145, Rob Williscroft r...@freenet.co.uk wrote:

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 xns9c09513903e8frtwfreenetremovec...@216.196.109.145, Rob Williscroft  r...@freenet.co.uk wrote: Aahz wrote innews:guao50$1j...@panix3.panix.comin comp.lang.python: In article

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

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

Re: sqlite single transaction without foreign key or triggers

2009-05-11 Thread gert
On 11 mei, 23:07, Rob Williscroft r...@freenet.co.uk 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

Re: sqlite single transaction without foreign key or triggers

2009-05-11 Thread Aahz
In article xns9c08e179b66d8rtwfreenetremovec...@216.196.109.145, Rob Williscroft r...@freenet.co.uk wrote: db.execute( ''' update sessions set uid = ? where uid = ? and exists( select * from users where uid = ? ) ''', (v['uid'],s.SID,