SQLite problems

bayer.justin at googlemail.com bayer.justin at googlemail.com
Thu Apr 12 05:52:42 EDT 2007


Hi there,

I run Python 2.5 on a Mac OS X system with SQLite 3.2.8 installed via
fink. Today I stumbled over the problem, that the sqlite3 module and
sqlite3 from fink do not seem to work well together. I brought it down
to this:

>>> from sqlite3 import Connection
>>> c = Connection("foo.bar")	# does not yet exist
>>> c.execute("CREATE TABLE foo (id integer)")
>>> c.execute("INSERT INTO foo VALUES (1)")
>>> c.execute("SELECT * FROM foo")
>>> c.execute("SELECT * FROM foo").fetchmany()
[(1,)]
>>> c.execute("INSERT INTO foo VALUES (2)")
>>> c.execute("SELECT * FROM foo").fetchmany(2)
[(1,), (2,)]

Then in sqilte:

$ sqlite3 foo.bar
SQLite version 3.2.8
Enter ".help" for instructions
sqlite> select * from foo;
SQL error: unsupported file format


If I create the database file with sqlite and open it from within
python, I cannot run any queries on that database, but no error is
thrown - it just passes silently.

Any ideas?

Regards,
-Justin




More information about the Python-list mailing list