0

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)

2
  • Have you tried executing the commands separated by semicolons (;)? Commented Jan 11, 2013 at 21:47
  • @coproc Please see my answer below about using semi-colons. Commented Jan 11, 2013 at 22:00

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.