当我初始化我的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
有解决方法吗?
答案 0 :(得分:1)
您可以尝试在那里发布的解决方案:
phoneGap Android - Populate database once "Error processing SQL:1"