我是 Appcelerator Titanium 的新手。我已经成功创建了数据库。当我尝试插入记录时,它显示错误,
[ERROR] Script Error = Error occurred calling next on a PLSqliteResultSet.
SQLite error: 'constraint failed' for 'INSERT INTO test (t_Id, t_Name)
VALUES (1,"sam")')' at app.js (line 24).
我的代码是:
Ti.Database.install('myDB.sqlite','myDB');
var db = Ti.Database.open('myDB');
db.execute('INSERT INTO test (t_Id, t_Name) VALUES (1,"sam")');
请帮我!!