What is the best SQL for a SQLite database to effectively do:
If Database Table Exists then - create table - insert row - insert row (i.e. for startup data) end What is the best SQL for a SQLite database to effectively do:
If Database Table Exists then - create table - insert row - insert row (i.e. for startup data) end To check that your table exists or not, you can use:
SELECT * FROM sqlite_master WHERE name ='myTable' and type='table'; You can let Sqlite itself check this out for you:
CREATE TABLE IF NOT EXISTS <table_name> ...; Follow link for documentation: https://sqlite.org/lang_createtable.html