【发布时间】:2013-10-11 17:25:37
【问题描述】:
当我尝试在我的插入查询中包含Api_key 列及其值时,我得到unrecognized token error,否则没有它,它可以正常工作。
代码如下:
public void InsertResult(String apikey,String auditid,String crit_id, int current_chap)
{
String s="INSERT OR IGNORE INTO Results(AuditID,CriteriaID,ChapterID,Api_key) VALUES("+auditid+","+crit_id+","+current_chap+","+apikey+")";
sp.execSQL(s);
}
这是我的日志:
10-11 22:45:09.655: E/AndroidRuntime(8124): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.oxtro.trustea/com.oxtro.trustea.ChapterActivity}: android.database.sqlite.SQLiteException: unrecognized token: "3249f6dc" (code 1): , while compiling: INSERT OR IGNORE INTO Results(AuditID,CriteriaID,ChapterID,Api_key) VALUES(1,13,13,3249f6dc-c3ca-4c8d-a4de-df1834c579c4)
【问题讨论】: