开发者

How to truncate table in sqlite in android [closed]

开发者 https://www.devze.com 2023-04-09 06:42 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist

Closed 9 years ago.

Improve this questi开发者_Go百科on

I am new in android. Can anyone help me to hows truncate table in sqlite in android.. Can anyone give me example of that delete table? Please help me.


What do you want to do? If you want to truncate the table (delete all data) you can use the DELETE query without a where condition. If you want to delete the entire table you can use a DROP TABLE query


It is the two step process:

  1. First delete all data from that table using this:

    Delete from TableName

  2. Second step:

    DELETE FROM SQLITE_SEQUENCE WHERE name='TableName';

     

0

精彩评论

暂无评论...
验证码 换一张
取 消