August 12, 2008
Executing Multiple Statements in a SQLlite transaction
Here is a quick example of how to execute multiple statements serially within a SQLite transaction. This example comes from the next beta of QuickConnectiPhone. I’m releasing it early here.
This code clears the values out of a table by dropping the table and then re-creating it all within one transaction and one asynchronous call.
var dropSQL = 'DROP TABLE session';
var createSQL = "CREATE TABLE IF NOT EXISTS session (key TEXT UNIQUE, information TEXT)";
tx.executeSql(dropSQL);//end of main executeSql call
});//end of transaction callback function