You can use a simple CREATE TABLE (without IF NOT EXISTS clause). If it succeeds then you populate table with data (remember to do that in the same transaction where you created the table). If CREATE TABLE fails then you don't insert your data.
Pavel On Mon, Mar 21, 2011 at 6:04 PM, Erich93063 <erich93...@gmail.com> wrote: > I am trying to create a SQLite database if it doesn't exist, which I > know I can use 'CREATE TABLE IF NOT EXISTS", but more importantly, I > need to initially populate the database with seed data if it doesn't > exist. If I use CREATE TABLE IF NOT EXISTS, it will obviously create > the table if it doesn't exist, but if I follow that up with insert > statements, those would ALWAYS get ran. I only want to enter the seed > data if the database does not exist. ??? > > THANKS > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users