Is there a way to execute multiple statements in a single transaction? I want to do something like:
db.transaction(function (tx) {
tx.executeSql(
"CREATE TABLE Foo(ID INTEGER); CREATE TABLE Bar(ID INTEGER)",
function (tx, result) {
alert("success!");
});
});
But instead, I'm finding I have to do something like this instead:
db.transaction(function (tx) {
tx.executeSql("CREATE TABLE Foo(ID INTEGER)");
tx.executeSql("CREATE TABLE Bar(ID INTEGER)",
function (tx, result) {
alert("success!");
});
});
Am I limited to having to execute individual statements in their own transaction and then fire off a successFn on the last transaction or is there a way I can execute multiple statements in a single transaction?