[html5] executeSql for multiple statements

Rob Kroeger rjkroege at liqui.org
Thu Feb 11 06:50:06 PST 2010

On Sunday, February 7, 2010, Jason Barnabe <jason.barnabe at gmail.com> wrote:
> Is SQLTransaction.executeSql supposed to support multiple statements in one call? I try the following in Chrome:
> openDatabase('test', '1.0', 'test', 1024).transaction(function (t) {
> 	t.executeSql('CREATE TABLE foo (id INTEGER);CREATE TABLE bar (id INTEGER)');
> }, reportError);
> function reportError(t, e) {
> 	alert(e.message);
> }
> Only the "foo" table is created, and no error is generated.

The intended behaviour is to only run one statement per call.
Google's open source WSPL library
(http://code.google.com/p/webstorageportabilitylayer/) provides a
wrapper for the HTML5 database functions that can execute multiple
statements with a single call. (The OSS version of the library has
several unfinished bugs but this feature works.)



Rob Kroeger
rjkroege at liqui.org

More information about the Help mailing list