On 28 Jun 2018, at 12:48pm, Scott Robertson wrote:
> CREATE TABLE test2 (
> id INTEGER PRIMARY KEY,
> book text,
> page INTEGER
> );
>
> INSERT INTO test2 VALUES ('Lord of the Rings', 327);
>
> Error: table test2 has 3 columns but 2 values were supplied
>
> INSERT INTO test2 VALUES (9, 'Lord
>INTEGER PRIMARY KEY doesn’t default to autoincrement. It’s used in place of
the automatically created >autoincrement rowid but you have to supply the
values (I.e. they’re not created automatically).
I stand corrected. If you supply null for the integer primary key it will
assign the highest rowi
INTEGER PRIMARY KEY doesn’t default to autoincrement. It’s used in place of the
automatically created autoincrement rowid but you have to supply the values
(I.e. they’re not created automatically).
On 28 Jun 2018, at 12:48, Scott Robertson wrote:
> SQLite is supposed to autoincrement by defaul
On 28 Jun 2018, at 12:48, Scott Robertson wrote:
> SQLite is supposed to autoincrement by default when a column is defined
> as "INTEGER PRIMARY KEY" according to everything I've read. But I've
> only gotten this to work if I let SQLite create its own PK column. If I
> have an explicit PK column,
SQLite is supposed to autoincrement by default when a column is defined
as "INTEGER PRIMARY KEY" according to everything I've read. But I've
only gotten this to work if I let SQLite create its own PK column. If I
have an explicit PK column, I am expected to specify an ID myself. What
am I missing?
5 matches
Mail list logo