[Python] sqlite

Carlo Miron carlo a miron.it
Mar 28 Dic 2010 17:22:32 CET


On Tue, Dec 28, 2010 at 16:05, Dalbosco Filippo
<Filippo.Dalbosco a apss.tn.it> wrote:
> ####### questo  ( è copiato da Active Python 2.6 documentation...)mi da
> ########## Traceback (most recent call last):
> ##########  File "<string>", line 38, in <fragment>
> ##########sqlite3.OperationalError: cannot commit transaction - SQL statements in  ###########progress
> # Do this instead
> symbol= 'IBM'
> t = (symbol,)
> c.execute('select * from stocks where symbol=?', t)

A me funziona™.

>>> c.execute('select * from stocks where symbol=?', t)
<sqlite3.Cursor object at 0xb78529e0>
>>> list(_)
[(u'2006-04-06', u'SELL', u'IBM', 500.0, 53.0)]

>  domanda: perché?

©
-- 
Carlo Miron
WorksForMe Solution Architect™


Maggiori informazioni sulla lista Python