当我初始化我的 Sqlite 数据库时,我将其设置如下:
var db = window.openDatabase("Database", "1.0", "Cordova Demo", 20000);
db.transaction(populateDB, errorCB, successCB);
function populateDB(tx) {
tx.executeSql('DROP TABLE IF EXISTS TimeTable');
tx.executeSql('CREATE TABLE IF NOT EXISTS TimeTable (id INTEGER PRIMARY KEY AUTOINCREMENT, Day, Subject, StartingTime, EndingTime)');}
现在,我不希望每次调用此函数时都删除表。但是当我删除这一行时:
tx.executeSql('DROP TABLE IF EXISTS TimeTable');
错误显示:
[INFO] Error processing SQL: 1
有解决方案吗?