No-value SQLite insert triggers OperationalError on Windows

Issue #1093 resolved
Former user created an issue

The attached script triggers this exception on Windows (but not Unix):

sqlalchemy.exc.OperationalError: (OperationalError) near "DEFAULT": syntax error u'INSERT INTO items DEFAULT VALUES' []

I am at a loss for what's going on here, but the fact that the statement is actually a Unicode string struck me as strange.

(This is on Python 2.5.2 and sqlalchemy 0.5.0beta1.)

Comments (3)

  1. Mike Bayer repo owner

    older versions of sqlite (which are not specifically known, they're not well documented) do not support the "DEFAULT VALUES" syntax. You need to upgrade the sqlite binary in use. Reopen this ticket if problems persist.

  2. Michael Trier

    Just to expound on this. The default installation of Python 2.5.2 on Windows installs the following versions:

    >>> print sqlite3.version  # pysqlite version
    2.3.2
    >>> print sqlite3.sqlite_version  #sqlite3 version
    3.3.4
    

    That version of the sqlite3 engine does not support the DEFAULT VALUES syntax, as zzeek stated. We might want to point out in the Installing a Database API section of the docs, or elsewhere, that the default version of the engine will not work properly.

  3. Log in to comment