Re: [sqlite] PRIMARY KEY? Date and time datatypes?

2008-02-18 Thread Gilles Ganault
On Mon, 18 Feb 2008 12:32:55 +, [EMAIL PROTECTED] wrote: >The AUTOINCREMENT keyword prevents an primary key from being >reused even after it is deleted. Thanks for the clarification. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlit

Re: [sqlite] PRIMARY KEY? Date and time datatypes?

2008-02-18 Thread Gilles Ganault
On Mon, 18 Feb 2008 23:31:32 +1100, BareFeet <[EMAIL PROTECTED]> wrote: >I can create a view to display the date in my localtime: Thanks much for the example. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/l

Re: [sqlite] PRIMARY KEY? Date and time datatypes?

2008-02-18 Thread drh
Gilles Ganault <[EMAIL PROTECTED]> wrote: > On Sat, 16 Feb 2008 11:29:29 +1100, BareFeet > <[EMAIL PROTECTED]> wrote: > > If you designate an integer column as also being the primary key, > > then SQLite will auto assign its value incrementally each time > > you insert a new row, unless you assign

Re: [sqlite] PRIMARY KEY? Date and time datatypes?

2008-02-18 Thread BareFeet
Hi Gilles, >> If you designate an integer column as also being the primary key, >> then SQLite will auto assign its value incrementally each time you >> insert a new row, unless you assign a value explicitly. > > In this case, why do we need to use "PRIMARY KEY AUTOINCREMENT"? Adding "autoi

Re: [sqlite] PRIMARY KEY? Date and time datatypes?

2008-02-18 Thread Gilles Ganault
On Sat, 16 Feb 2008 11:29:29 +1100, BareFeet <[EMAIL PROTECTED]> wrote: > If you designate an integer column as also being the primary key, > then SQLite will auto assign its value incrementally each time > you insert a new row, unless you assign a value explicitly. In this case, why do we need

Re: [sqlite] PRIMARY KEY? Date and time datatypes?

2008-02-15 Thread BareFeet
Hi Gilles, > 1. what happens if I leave out "PRIMARY KEY" and just use INTEGER? Um, then it won't be a primary key. Integer just means a whole number. Primary key means that the database will treat that column as the unique identifier for each row. In actuality this means that SQLite will tr

[sqlite] PRIMARY KEY? Date and time datatypes?

2008-02-15 Thread Gilles Ganault
Hello I have a couple of questions on using SQLite3: 1. what happens if I leave out "PRIMARY KEY" and just use INTEGER? 2. I prefer to use text to save dates and times because they're easier to handle between SQLite and PHP than Julian, but does SQLite handle text dates/times OK, or should I exp