SQLite Forum

FEATURE REQUEST: use of DEFAULT in INSERTs
Login
Hello sqlite community

I would like to be able to specify the use of DEFAULT values within INSERT statements (on column level):

Here is an example:

~~~
CREATE TABLE t1 (
      a   INTEGER DEFAULT 1 NOT NULL
    , b   INTEGER DEFAULT 2 NOT NULL
    , c   INTEGER DEFAULT 3 NOT NULL
);
~~~
~~~
INSERT INTO t1 
  (a      , b      , c      ) VALUES 
  (10     , DEFAULT, DEFAULT)
, (DEFAULT, 20     , DEFAULT)
, (DEFAULT, DEFAULT, 30     )
;
~~~

would be working with this feature.

I know that 3 different INSERT statements would work:

~~~
INSERT INTO t1 (a) VALUES (10);
INSERT INTO t1 (b) VALUES (20);
INSERT INTO t1 (C) VALUES (30);
~~~

or as well this statement:

~~~
INSERT INTO t1 DEFAULT VALUES;
~~~

I found this thread [here], which explains more.
(but is wrong in some parts)

Is there a chance to include this feature?

Thanks a lot!

Philipp

[here]: https://stackoverflow.com/questions/8777362/how-to-insert-default-values-in-sql-table