我正在使用 sqlite 编写一个小型应用程序。
调试器说有语法错误。我试过但我找不到它在哪里。
12-20 14:13:40.353: E/SQLiteLog(2329): (1) 靠近 ",": 语法错误
SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase$CursorFactory, String, String[], String, CancellationSignal) line: 1317
SQLiteDatabase.rawQuery(String, String[]) line: 1253
TemporaryDatabase.EntryGiris(int, String, int, int, int, int, int, int, int, int, int) 行:125
这是代码:
public class TemporaryDatabase {
......
String entryGirisSQL="SELECT "+C_ID
+" FROM harcamalar WHERE "+C_YIL+"="
+yilsql+","+C_AY+"="+aysql;
Cursor cursor=ourDatabase.rawQuery(entryGirisSQL, null);
int index=cursor.getColumnIndex(C_ID);
if(index>=0)
ourDatabase.update(DB_TABLE, cv, "c_id="+index, null);
else ourDatabase.insert(DB_TABLE, null, cv);
}
}