表從XML生成的,它看起來像這樣 CREATE TABLE orders (id INTEGER AUTO-INCREMENT PRIMARY KEY , id_room INTEGER, nr_table INTEGER, id_user INTEGER, id_payment INTEGER, total INTEGER)
插入不工作爲什麼?
com.DataConnector.DataConnector.getInstance(getApplicationContext()).executeQuery("INSERT INTO sync_log (table_name,rec_id,upd,del,synchronized)" +"VALUES (\"orders\",2,1,0,0) ");
這一個工作沒有問題。
Boolean ab=com.DataConnector.DataConnector.getInstance(getApplicationContext()).executeQuery(
"INSERT INTO orders (id_room,nr_table,id_user,id_payment,total)" +"VALUES (1,1,1,0,100) ");
這將引發
no such column: orders (code 1): , while compiling: INSERT INTO orders (id_room,nr_table,id_user,id_payment,total)VALUES (1,1,1,0,100)
Log.i("cursor id", cursor.getColumnName(0) + cursor.getColumnName(1) + cursor.getColumnName(2) + cursor.getColumnName(3) +cursor.getColumnName(4) + cursor.getColumnName(5));
returns `idid_roomnr_tableid_userid_paymenttotal
,所以我有表,列
所以這個問題是我怎麼能解決沒有這樣的列問題 –
您是否已經驗證表,訂單和其列?我會先檢查一下。 –
'SELECT name FROM sqlite_master WHERE type ='table'AND name ='table_name';'yes如果你想到這個,返回的是一個名爲colmun的光標,我不知道它是否好? –