I have a parser that parses XML file into SQLite database, and the current implementation generates the ‘create table xyz …’ even the table is already existed.
- Is this OK? I mean, is this OK to run ‘create table’ even when the table exists in db?
- If not, is there easy way to check the names of tables (and its contents) that SQLite db has?
What you are searching for is CREATE TABLE IF NOT EXISTS and the FAQ entry How do I list all tables/indices contained in an SQLite database.
Creating a table without the “IF NOT EXISTS” option will lead to an error.