在Android中,如何在不传递任何参数的情况下删除表中的整个记录?
海我创建了一个数据库并将值插入一个类中,我尝试删除另一个类中的记录,但是整个表被删除。我只需要删除整个记录而不删除表。是否可以删除所有记录无条件记录? 请帮助我 提前致谢
public void deletePayment()
{
db.delete(DATABASE_TABLE3, "KEY_ROLLID=?",null);//i want to delete all row in KEY_ROLLID
}
Hai i created a DataBase and inserted the value in one Class,and i try to delete the record in another class but,the Whole table is Deleted.i need to delete the entire record only without deleteing the table.is it possible to delete all record without any condition?
kindly help me
Thanks in advance
public void deletePayment()
{
db.delete(DATABASE_TABLE3, "KEY_ROLLID=?",null);//i want to delete all row in KEY_ROLLID
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你不会尝试DELETE语句,
在android中你也可以使用db.rawQuery执行Sql查询,在这里你可以为你的表传递Delete语句,如:
db.rawQuery("Delete FROM Table_Name");
You doesn't try DELETE Statement,
In android you can execute Sql Query with db.rawQuery also, in this you can pass Delete Statement for your table, as:
db.rawQuery("Delete FROM Table_Name");
使用这个概念:
Use this concept: