On 27 Jun 2017, at 8:13pm, Robert M. Münch <robert.mue...@saphirion.com> wrote:

> CREATE TABLE test(a, b DEFAULT "-", c, d)
> 
> Now I would like to use
> 
> INSERT VALUES(a,?,c,d)
> 
> Where ? is something that the default value is used and not the provided 
> value. Is this possible at all?

You provide the text "NULL" (not in any quotes) for that value:

INSERT INTO test VALUES(12, NULL, 84, 'endomorph')

If you’ve set up a statement with parameters …

INSERT INTO test VALUES(?1, ?2, ?3, ?4)

… you can leave that paramater unbound (all parameters are bound to NULL by 
default) or you can explicitly bind it to NULL using sqlite3_bind_null() .

Do not confuse NULL, which is the NULL value, with 'NULL' in those quotes, 
which is a four character string.

Simon.

_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to