Programming, Uncategorized
comments 3

SQLite3 Exception: SQL logic error or missing database

So this morning I was trying to update a testing machine with my shiny new Rails app.

  • Remove the sqlite database – CHECK
  • run rake db:migrate – CHECK
  • start the application

Now there were no errors anywhere. But I still get:

SQLite3::SQLException: SQL logic error or missing database

After usual googling around and trying to fix it I just saw what the problem with the Query is. The reason for the exception is putting a ‘NULL’ into non NULL column. And SQLite says “missing database”. Way to write the exceptions.

Note to Self: Always write meaningful or at least non-misleading exception messages.


  1. Narender Ramireddy says

    Make sure you close the ResultSet and the Statements.

  2. Rishikesh Kamerkar says

    if your problem is related to if you are losing database created on sdcard  everytime you start emulator …then please dont select wipe user data while starting the emulator

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>