2
I have a generated script from SQL Server it contains multiple tables and views, I plan to carry this database to my Android Sqlite.
How do I run the script on Sqlite on Android ?
2
I have a generated script from SQL Server it contains multiple tables and views, I plan to carry this database to my Android Sqlite.
How do I run the script on Sqlite on Android ?
3
Follow the following steps:
On the side of the Sqlserver manages the script rearing.
Change the script in order to be compatible with Sqlite.
Derive from Sqliteopenhelper and use the script the same way it does when it creates any other bank, using db.execSQL()
.
Note: db.execSQL()
only executes one SQL command at a time. You have to retrieve each of the existing SQL commands in script and run them one by one, something like that:
StringTokenizer tokenizer = new StringTokenizer( script, ";", false);
while (tokenizer.hasMoreTokens())
{
db.execSQL(tokenizer.nextToken());
}
Browser other questions tagged android sqlite
You are not signed in. Login or sign up in order to post.
You have to be more specific in the difficulty you have. Anyway you can say that it is possible that the script(SQL) is not compatible with Sqlite,
– ramaral
There is a way to transport my database (SQL) to an internal Android database?
– Joy Peter
Face of a googled...
– Denis
You know how to create a database in Sqlite via Sqliteopenhelper?
– ramaral
Yes, I can create.
– Joy Peter