Try this

SELECT * FROM dbname.sqlite_master WHERE type='table' AND name='tbname';


Change dbname with name of your database and tbname with the name of table.


------

speco 




> To: sqlite-users@sqlite.org
> From: itandet...@mvps.org
> Date: Fri, 9 Mar 2012 20:30:55 -0500
> Subject: Re: [sqlite] Building an SQLite Extension: How to check if a table   
> exists in the database?
> 
> Wei Song <wei.s...@senecacollege.ca> wrote:
> > I'm developing an SQLite extension which uses a function to set data into a 
> > table. I'd like to know how to check if a table
> > exists in a database? 
> 
> Just prepare the statement that you are going to use to write the data, and 
> handle any errors.
> -- 
> Igor Tandetnik
> 
> _______________________________________________
> 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

Reply via email to