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
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users