Re: [sqlite] quick question regarding INTEGER PRIMARY KEY default value

2005-02-02 Thread Randall Fox
On Wed, 2 Feb 2005 09:22:09 -0800 (PST), you wrote: > >You really should not rely on implicit assumptions in your code, >such as 'the first value of an autoincrement field is 1'. If you >use a different database, or different version of this one, that >may be wrong and a nightmare to fix. True, b

Re: [sqlite] quick question regarding INTEGER PRIMARY KEY default value

2005-02-02 Thread Ulrik Petersen
Jay wrote: You really should not rely on implicit assumptions in your code, such as 'the first value of an autoincrement field is 1'. If you use a different database, or different version of this one, that may be wrong and a nightmare to fix. There are calls that will return the value of the field

Re: [sqlite] quick question regarding INTEGER PRIMARY KEY default value

2005-02-02 Thread Jay
You really should not rely on implicit assumptions in your code, such as 'the first value of an autoincrement field is 1'. If you use a different database, or different version of this one, that may be wrong and a nightmare to fix. There are calls that will return the value of the field after it'

Re: [sqlite] quick question regarding INTEGER PRIMARY KEY default value

2005-02-02 Thread Stephen C. Gilardi
It is documented to start at 1: If a table contains a column of type INTEGER PRIMARY KEY, then that column becomes an alias for the ROWID. [...] If no ROWID is specified on the insert, an appropriate ROWID is created automatically. The usual algorithm is to g

[sqlite] quick question regarding INTEGER PRIMARY KEY default value

2005-02-02 Thread Andrew Shakinovsky
Will the default value of an INTEGER PRIMARY KEY column always start at 1? Example: CREATE TABLE xyz (id INTEGER PRIMARY KEY); INSERT INTO xyz VALUES (NULL); Will the value of the id column always be 1 in this example? I tried numerous tests, and it seems to always start at 1, I wanted to just mak