Re: [sqlite] to find table exists or not

2012-12-06 Thread kyan
On Thu, Dec 6, 2012 at 6:49 PM, Staffan Tylen wrote: > SELECT CASE WHEN EXISTS (...) END > > On Thu, Dec 6, 2012 at 5:47 PM, Durga D wrote: > >> I have situation in which I want to read particular record if table exists. >> Based on that record

Re: [sqlite] to find table exists or not

2012-12-06 Thread Igor Tandetnik
On 12/6/2012 11:47 AM, Durga D wrote:> I have situation in which I want to read particular record if table exists. Based on that record information, I have to execute some logic on other tables of the same database. If record doesn't exist I need to create new table. Prepare a statement to

Re: [sqlite] to find table exists or not

2012-12-06 Thread Staffan Tylen
> INSERT OR IGNORE INTO ... > > > (set missing options to default while keeping pre-set values) > > > > > > -Ursprüngliche Nachricht----- > > > Von: Stephen Chrzanowski [mailto:pontia...@gmail.com] > > > Gesendet: Donnerstag, 06. Dezember 2012 11:

Re: [sqlite] to find table exists or not

2012-12-06 Thread Durga D
> > > You can always do > > > > > > DROP TABLE IF EXISTS ... > > > CREATE TABLE ... > > > > > > to replace the definition or > > > > > > CREATE TABLE IF NOT EXISTS ... > > > > > > to keep the old def

Re: [sqlite] to find table exists or not

2012-12-06 Thread Dave McKee
ault while keeping pre-set values) > > -Ursprüngliche Nachricht- > Von: Stephen Chrzanowski [mailto:pontia...@gmail.com] > Gesendet: Donnerstag, 06. Dezember 2012 11:21 > An: General Discussion of SQLite Database > Betreff: Re: [sqlite] to find table exists or not > > I can thi

Re: [sqlite] to find table exists or not

2012-12-06 Thread Hick Gunter
: Stephen Chrzanowski [mailto:pontia...@gmail.com] Gesendet: Donnerstag, 06. Dezember 2012 11:21 An: General Discussion of SQLite Database Betreff: Re: [sqlite] to find table exists or not I can think of two reasons why you wouldn't want to blindly delete the table, but verify that it exists. - First

Re: [sqlite] to find table exists or not

2012-12-06 Thread Stephen Chrzanowski
> An: General Discussion of SQLite Database > Betreff: [sqlite] to find table exists or not > > Hi all, > > > I just want to find whether table exists or not in a database. > > > Is it correct query? > > > select distinct tbl_name from sqlite_ma

Re: [sqlite] to find table exists or not

2012-12-05 Thread Hick Gunter
: Mittwoch, 05. Dezember 2012 15:33 An: General Discussion of SQLite Database Betreff: [sqlite] to find table exists or not Hi all, I just want to find whether table exists or not in a database. Is it correct query? select distinct tbl_name from sqlite_master where tbl_name = 'abc'; Is there any

Re: [sqlite] to find table exists or not

2012-12-05 Thread Simon Slavin
On 5 Dec 2012, at 2:33pm, Durga D wrote: > I just want to find whether table exists or not in a database. > > > Is it correct query? > > > select distinct tbl_name from sqlite_master where tbl_name = 'abc'; This may return zero lines or many. Because indexes and

[sqlite] to find table exists or not

2012-12-05 Thread Durga D
Hi all, I just want to find whether table exists or not in a database. Is it correct query? select distinct tbl_name from sqlite_master where tbl_name = 'abc'; Is there any other better way to find whether table exists or not. Thanks in advance. Regards,