If you have a string representation of a multiline SQLite command, is there any way to execute without looping through each command. IE sqLiteDatabase.execSQL(statement)
-
Have you tried executing the commands separated by semicolons (;)?coproc– coproc2013-01-11 21:47:57 +00:00Commented Jan 11, 2013 at 21:47
-
@coproc Please see my answer below about using semi-colons.Sam– Sam2013-01-11 22:00:19 +00:00Commented Jan 11, 2013 at 22:00
Add a comment
|
1 Answer
You must call each command separately.
I assume you are just double-checking, but the execSQL() documentation is quite clear:
Parameters
sql the SQL statement to be executed. Multiple statements separated by semicolons are not supported.
The same is true for the matching rawQuery() method:
Parameters
sql the SQL query. The SQL string must not be ; terminated