rawquery中的错误:靠近“,”

时间:2012-07-29 18:37:41

标签: android sqlite

尝试插入数据时我收到此错误

07-29 18:15:19.909: E/sqlite(863): android.database.sqlite.SQLiteException: near ",": syntax error: , while compiling: INSERT INTO transactions (details , amount) VALUES( , );

我认为此行中的错误无法排序,有助于任何人

String insertQuery = "INSERT INTO " +stdb.tname+" (" + stdb.details+" , "+stdb.amt+") VALUES("+setdet+" , "+setamt+");";

1 个答案:

答案 0 :(得分:1)

似乎setdetsetamt都是空的。这导致无效的声明:

INSERT INTO transactions (details , amount) VALUES( , );