Re: defaulting date/time to current

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: 3 Oct 2002 00:29:57 -0700
Message-ID: <a20d28ee.0210022329.2074bb54_at_posting.google.com>


mfaine_at_knology.net (Mark) wrote in message news:<329dd608.0210021054.189bab2a_at_posting.google.com>...
> Would this work in a CREATE TABLE command:
> create table "form" (
> "form_number" char(8) not null,
> ...
> "form_revision_date" date default (select to_char(sysdate, 'yyyy-mm-dd
> hh24:mi:ss') from dual;) not null,
> ...
> );
>
> Or (even if it doesn't produce a syntax error) would that make the
> date/time always default to the date/time when the table was created.
>
> Thanks,
> -Mark

it wouldn't work. default sysdate is the proper syntax, and it would make the date/time default to the date/time the *record* was created (which is what you probably want)

Hth

Sybrand Bakker
Senior Oracle DBA

Sybrand Bakker Received on Thu Oct 03 2002 - 09:29:57 CEST

Original text of this message