Re: [sqlite] How to determine if a column is autoincremented?

2005-10-25 Thread Gerry Snyder
Thomas Briggs wrote: See http://www.sqlite.org/autoinc.html - INTEGER PRIMARY KEY will autoincrement only until you delete a row from the table. The above seems overstated. INTEGER PRIMARY KEYs with or without the AUTOINCREMENT keyword behave identically unless 1) the last row is deleted

RE: [sqlite] How to determine if a column is autoincremented?

2005-10-25 Thread Thomas Briggs
s@sqlite.org > Subject: Re: [sqlite] How to determine if a column is autoincremented? > > You learn something new everyday. I didn't know that was the > behaviour of > INTEGER PRIMARY KEY. All other databases I've worked with > require you to > explicitly dec

Re: [sqlite] How to determine if a column is autoincremented?

2005-10-24 Thread Mario Gutierrez
E my_table ( id INTEGER PRIMARY KEY, ... ) This would meet your criteria, but 'id' is not an autoincremented column. -- Mario Gutierrez mario.l.gutierrez @ hotmail.com From: "David M. Cook" <[EMAIL PROTECTED]> Reply-To: sqlite-users@sqlite.org To: sqlite-users@sqlite.org Subject

Re: [sqlite] How to determine if a column is autoincremented?

2005-10-24 Thread David M. Cook
On Sat, Oct 22, 2005 at 12:19:04PM -0700, Mario Gutierrez wrote: > Thanks for the reply. > > This would not work as I could define a table like this > > CRETE TABLE my_table ( > id INTEGER PRIMARY KEY, > ... > ) > > This would meet your criteria, but 'id' is not an autoincremented column. OK,

Re: [sqlite] How to determine if a column is autoincremented?

2005-10-24 Thread David M. Cook
On Sun, Oct 23, 2005 at 09:24:58PM -0700, David M. Cook wrote: > On Sat, Oct 22, 2005 at 12:19:04PM -0700, Mario Gutierrez wrote: > > > CRETE TABLE my_table ( > > id INTEGER PRIMARY KEY, > > ... > > ) > > > > This would meet your criteria, but 'id' is not an autoincremented column. > > Sorry,

Re: [sqlite] How to determine if a column is autoincremented?

2005-10-23 Thread Peter Bierman
oincremented column. -- Mario Gutierrez mario.l.gutierrez @ hotmail.com From: "David M. Cook" <[EMAIL PROTECTED]> Reply-To: sqlite-users@sqlite.org To: sqlite-users@sqlite.org Subject: Re: [sqlite] How to determine if a column is autoincremented? Date: Sat, 22 Oct 2005 10:52:20 -

Re: [sqlite] How to determine if a column is autoincremented?

2005-10-23 Thread David M. Cook
On Sat, Oct 22, 2005 at 12:19:04PM -0700, Mario Gutierrez wrote: > CRETE TABLE my_table ( > id INTEGER PRIMARY KEY, > ... > ) > > This would meet your criteria, but 'id' is not an autoincremented column. Sorry, I don't get it. Why is it not? Also, why would one do that? If I wanted an non-a

Re: [sqlite] How to determine if a column is autoincremented?

2005-10-22 Thread Mario Gutierrez
. Cook" <[EMAIL PROTECTED]> Reply-To: sqlite-users@sqlite.org To: sqlite-users@sqlite.org Subject: Re: [sqlite] How to determine if a column is autoincremented? Date: Sat, 22 Oct 2005 10:52:20 -0700 On Fri, Oct 21, 2005 at 05:38:28PM -0700, Mario Gutierrez wrote: > I'm w

Re: [sqlite] How to determine if a column is autoincremented?

2005-10-22 Thread Mario Gutierrez
-- Mario Gutierrez mario.l.gutierrez @ hotmail.com From: Kurt Welgehausen <[EMAIL PROTECTED]> Reply-To: sqlite-users@sqlite.org To: sqlite-users@sqlite.org Subject: Re: [sqlite] How to determine if a column is autoincremented? Date: Sat, 22 Oct 2005 12:49:30 -0500 select sql from sqlite_m

Re: [sqlite] How to determine if a column is autoincremented?

2005-10-22 Thread David M. Cook
On Fri, Oct 21, 2005 at 05:38:28PM -0700, Mario Gutierrez wrote: > I'm writing a SQLite adapter for a code generation tool. I'm a little > stumped on how you query SQLite to determine if a column is > autoincremented. I've tried An auto-increment column is defined as INTEGER PRIMARY KEY, so loo

Re: [sqlite] How to determine if a column is autoincremented?

2005-10-22 Thread Kurt Welgehausen
select sql from sqlite_master where type='table' and tbl_name='my_table' and sql like '%autoincrement%' OR select sql like '%autoincrement%' from (select sql from sqlite_master where type='table' and tbl_name='my_table') Regards

[sqlite] How to determine if a column is autoincremented?

2005-10-21 Thread Mario Gutierrez
Hi all, I'm writing a SQLite adapter for a code generation tool. I'm a little stumped on how you query SQLite to determine if a column is autoincremented. I've tried PRAGMA table_info('my_table'); which returns all the columns for the table including a flag to tell if the column is