Sqlite deleting all rows

Hello group
I’m converting my program from Ms Access to SQLite, at least I’m trying. I have a problem with completely deleting a table, I wrote:

deleteSQL = "DELETE * FROM "+TabellaDaEliminare
Try
  db.ExecuteSQL(deleteSQL)

error is:Exception: near “*”: syntax error

What is ?

Ok, I found out that I don’t have to enter *, so I just. DELETE FROM NameOfTable and it works. :slight_smile:

After emptying a table, it is usually a good idea to reset the auto increment counter.

DELETE FROM SQLITE_SEQUENCE WHERE name='table_name';
3 Likes

Even better would be to use TRUNCATE TABLE NameOfTable

Unfortunately, SQLite does not support the TRUNCATE command :person_shrugging:

so the ID starts from zero? If so it is not useful to me since the data refers to the table … so the data could cross-reference