MarcoN <[EMAIL PROTECTED]> wrote:
> Hello, everybody.
> 
> I have the following problem: I have an old project that uses a database
> created with an older SQLite library version.
> Now, since I updated SQLite to 3.5.5, I can't use the database anymore,
> because any query on the database tables returns:
> 
> SQLite error 11 - Malformed database schema - near ")": syntax error
> 

There is a syntax error in many of your VIEW definitions.
A typical example is _TestViewExtra where you have:

     MonthType IN (1, 2, )

There is an extra comma after the "2".  To fix this, I suggest
dropping all views from the database as follows:

   (1) Start the CLI:  sqlite3 baddatabase.db

   (2) Enter:  "PRAGMA writable_schema=ON".
   
   (3) Enter:  "select * from sqlite_master".  Ignore the error.

   (4) Enter:  "DELETE FROM sqlite_master WHERE type='view'"

   (5) Exit the CLI

Then go back and recreate your views using valid syntax.

There was apparently a bug in older versions of SQLite that allowed
the incorrect syntax to get through without raising an error.  That
bug has now been fixed, which made your database unreadable.

--
D. Richard Hipp <[EMAIL PROTECTED]>

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to