Dear Developers,
Thank you very much for all previous answers - we use these in our new developed app.
Now we have the following question concerning DroidScript working with SQLite database.
When we try to perform the following functions -> undefinded error appears and there aren't any columns and table in the "MyPets" file.
function dbStartingInitialization() {
// Create or open database MyPets
db = app.OpenDatabase("MyPets");
// Create a table (if it doesn't exist already)
db.ExecuteSql( "CREATE TABLE IF NOT EXIST pets (id integer primary key, name text, catordog text, breed integer, birthday text, weight integer, gender integer, common text)" );
// E.g. insert first pet
db.ExecuteSql( "INSERT INTO pets(name, catordog, breed, birthday, weight, gender, common) VALUES (?,?,?,?,?,?,?)", ["Dory", "Dog", 0, "15.09.2015", 10, 1, "Best dog"], OnSuccess, OnError );
}
// Callback for successsful SQL execution
function OnSuccess( results ) {
app.ShowPopup("SQL-demand is Ok");
}
// Callback for errors when SQL execution
function OnError( error) {
app.ShowPopup("Error: " + error.message );
}
May be we made something wrong. Could you see and tell us pls your assumptions?
Thank you very much in advance.
Have a nice day.
Best regards
Dmitry