pysqlite problem

Tim Golden tim.golden at viacom-outdoor.co.uk
Wed Mar 1 12:35:22 CET 2006


[bapolis at gmail.com]

| I'm getting the following error:
| 
| pysqlite2.dbapi2.OperationalError: no such table: tbl1
| 
| Here's my code:
| 
| from pysqlite2 import dbapi2 as sqlite
| con = sqlite.connect(":memory:", detect_types=sqlite.PARSE_COLNAMES)
| cur = con.cursor()
| cur.execute("select * from tbl1")

It may be that you've misunderstood something here (or that I have).
You appear to be attaching to a sqlite in-memory database which
does not exist before you connect to it. Therefore you
are guaranteed *not* to have a table called tbl1 unless
you create it first.

Have you missed out some code for the purposes of brevity?
Or have you misunderstood what the :memory: pseudo-filename
is for?

TJG


________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________



More information about the Python-list mailing list