sql - Java-Sqlite Truncate all Database tables -
how truncate tables in sqlite database using java?
i know can this
{ ... string table_name1 = "delete table_name1"; string table_name2 = "delete table_name2"; string table_name3 = "delete table_name3"; string table_name4 = "delete table_name4"; string table_name5 = "delete table_name5"; stmt.executeupdate(table_name1); ... }
i can execute these strings task increases lines of code.
is there way truncate tables in database single command, without separately typing there names?
there's no truncate
in sqlite. can use delete <tablename>
delete table contents. you'll need separately each table.
however, if you're interested in removing data, consider deleting database file , creating new one.
Comments
Post a Comment