It works quite fine:

sqlite> create table a(a,b text default (datetime()));
sqlite> insert into a (a) values (1);
sqlite> insert into a (a) values (2);
sqlite> select * from a;
1|2013-05-20 13:27:30
2|2013-05-20 13:27:34


---
()  ascii ribbon campaign against html e-mail
/\  www.asciiribbon.org

> -----Original Message-----
> From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-
> boun...@sqlite.org] On Behalf Of Simon Slavin
> Sent: Monday, 20 May, 2013 07:17
> To: General Discussion of SQLite Database
> Subject: Re: [sqlite] Create Table oddity
> 
> 
> On 20 May 2013, at 4:55am, Simon Slavin <slav...@bigfraud.org> wrote:
> 
> > I wonder if there's a difference between
> >
> > DEFAULT date('now')
> >
> > and
> >
> > DEFAULT (date('now'))
> 
> Bah.  Of course, you can't do either:
> 
> <http://www.sqlite.org/lang_createtable.html>
> 
> "An explicit DEFAULT clause may specify that the default value is NULL, a
> string constant, a blob constant, a signed-number, or any constant
> expression enclosed in parentheses. An explicit default value may also be
> one of the special case-independent keywords CURRENT_TIME, CURRENT_DATE or
> CURRENT_TIMESTAMP."
> 
> No variable expressions at all, with a non-standard hack to allow time-
> sensitive values.
> 
> Simon.
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users



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

Reply via email to