SQLite Forum

current_date, etc are functions?
Login
In SQLite, you can use functions in default values, but you have to surround them with parenthesis :
```sql
sqlite> create table t1(a, b default current_date);
sqlite> create table t2(a, b default strftime('%Y','now'));
Error: near "(": syntax error
sqlite> create table t2(a, b default (strftime('%Y','now')));
sqlite> insert into t2(a) values(1); select * from t2;
1|2020
```

~~~
-- 
Regards,
Kees Nuyt
~~~