Thanks, I implemented this and it works.

I also stumbled upon the CREATE TABLE IF NOT EXIST syntax and I was
wondering if this wouldn't be a better idea, at the very least it would be
more convenient.

Olaf


----- Original Message ----- 
From: "Philipp Knüsel" <[EMAIL PROTECTED]>
To: <sqlite-users@sqlite.org>
Sent: Tuesday, April 04, 2006 2:34 PM
Subject: Re: [sqlite] Testing for table existence?


> > Hi,
> >
> > How can I test for the existence of a single table in a SQLite database?
> >
> > I tried sqlite3_get_table with "select * from persons" to test for the
existence of the table 'persons' and I had hoped the return value would be
SQLITE_NOTFOUND in the case of a non-existent table. However, I got
SQLITE_ERROR, which is less helpfull.
> >
> > Any hints?
> >
> > Regards,
> >
> > Olaf
>
> Hello Olaf
>
> You can access the sqlite_master table.
>
> http://www.sqlite.org/cvstrac/wiki?p=InformationSchema
>
> enjoy!
>
> Philipp
>

Reply via email to