It seems docs/compile.html is wrong.

SQLITE_OMIT_DATETIME_FUNCS
If this option is defined, SQLite's built-in date and time manipulation 
functions are omitted. Specifically, the SQL functions julianday(), date(), 
time(), datetime() and strftime() are not available. The default column 
values CURRENT_TIME, CURRENT_DATE and CURRENT_DATETIME are still available.

So it should be CURRENT_TIMESTAMP instead of CURRENT_DATETIME.

Thanks.

--------------------------------------------------
From: "P Kishor" <[EMAIL PROTECTED]>
Sent: Thursday, May 29, 2008 12:54 AM
To: "General Discussion of SQLite Database" <sqlite-users@sqlite.org>
Subject: Re: [sqlite] How to add a column with CURRENT_DATETIME?

> On 5/28/08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>> I am trying to create a table with a column with default value of current 
>> datetime (on insertion). But the following sql script can pass, but does 
>> not do what it is supposed to do.
>>
>>  What is the correct syntax?
>>
>>  create table ViewState
>>  (
>>   session_id text not null,
>>   viewstate_key text not null,
>>   viewstate blob,
>>   timestamp text default CURRENT_DATETIME
>>  )
>>  ;
>
>
> sqlite> CREATE TABLE foo (i INTEGER PRIMARY KEY, t TEXT, d DATETIME
> DEFAULT CURRENT_TIMESTAMP);
> sqlite> INSERT INTO foo (t) VALUES ('junk');
> sqlite> SELECT * FROM foo;
> 1|junk|2008-05-28 16:53:42
> sqlite>
> _______________________________________________
> 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