SQLite ExecSql not working from file

I am writing an Android application version 3.2, and then ASUS Eee Pad TF01, which requested an update, this changed the version of Android to 4.0.3. Since then I have problems with the application, I traced it to SQLite DB, it stops with an error in a table that does not exist.

Then I compared the application with the NOTEPAD example, which worked. In my application for creating a database, I read creating a script from a file in String, and then used execSQL, this worked fine before, but it doesnโ€™t work for this now. I checked some other things.

  • The file is still reading normally,
  • After reducing the contents of the file to two tables still not working
  • Checked a file on tools SQLite databse browser (2.0b1) under Windows, without problems

I think it could be characters (sort type) or maybe character encoding in SQL file or invalid characters.

Any idea how I can solve this problem?

+4
source share
1 answer

This is because execsql does not process multiple SQL commands,

see - Executing multiple statements with SQLiteDatabase.execSQL for a full explanation.

How it worked before is a secret ...

+3
source

Source: https://habr.com/ru/post/1399251/


All Articles