该表是从 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
所以我有表,列