Re: [sqlite] Assigning default values...

2016-12-20 Thread Jens Alfke
FYI, the syntax of the INSERT statement is described here: http://www.sqlite.org/lang_insert.html and this paragraph describes your situation exactly: • The first form (with the "VALUES" keyword) creates one or more new rows in an existing table.

Re: [sqlite] Assigning default values...

2016-12-20 Thread Simon Slavin
On 20 Dec 2016, at 8:19pm, jic...@yahoo.com wrote: > sqlite> INSERT INTO Years VALUES(4); > Error: table YEARS has 2 columns but 1 values were supplied > > […] > > How can I make DEFAULT work? INSERT INTO Years (IDYear) VALUES (4); Simon. ___ sqlite

[sqlite] Assigning default values...

2016-12-20 Thread jicman
Trying to learn or understand constraints. Please take a look at the following… sqlite> PRAGMA foreign_keys=1; sqlite> BEGIN TRANSACTION; sqlite> DROP TABLE IF EXISTS Years; sqlite> CREATE TABLE Years ...> ( ...> IDYear INTEGER PRIMARY KEY, ...> Year TEXT DEFAULT '1980' ...> ); sqlit