今天写更新语句,迷迷糊糊使用了下面的语句(乱造语法…):
db.execSQL("update tb_outaccount set money ,time,type,address ,mark=?,?,?,?,? where _id=?",
new Object[] {
tb_outaccount.getMoney(),
tb_outaccount.getTime(),
tb_outaccount.getType(),
tb_outaccount.getAddresss(),
tb_outaccount.getMark(),
tb_outaccount.getId()
}
);
正确写法(我相信这世界上只有我会写错…):
db.execSQL("update tb_outaccount set money = ?,time = ?,type = ?,address = ?,mark = ? where _id=?",
new Object[] {
tb_outaccount.getMoney(),
tb_outaccount.getTime(),
tb_outaccount.getType(),
tb_outaccount.getAddresss(),
tb_outaccount.getMark(),
tb_outaccount.getId()
}
);