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: :slight_smile:](https://forum.xojo.com/images/emoji/apple/slight_smile.png?v=12)
Jeremie_L
(Jeremie_L)
3
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
Tim_Hare
(Tim Hare)
4
Even better would be to use TRUNCATE TABLE NameOfTable
Scott_C
(Scott C)
5
Unfortunately, SQLite does not support the TRUNCATE command ![:person_shrugging: :person_shrugging:](https://forum.xojo.com/images/emoji/apple/person_shrugging.png?v=12)
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