Received: from koi.tsukebe.net (root@h-207-228-97-66.gen.cadvision.com [207.228.97.66]) by hub.org (8.9.3/8.9.3) with ESMTP id GAA06109 for ; Tue, 18 Apr 2000 06:37:25 -0400 (EDT) (envelope-from ty@koi.tsukebe.net) Received: from ip74.tsukebe.net ([207.228.97.74] helo=indus) by koi.tsukebe.net with smtp (Exim 3.03 #3) id 12hVT1-0000w6-00 for pgsql-admin@postgresql.org; Tue, 18 Apr 2000 10:42:51 +0000 Message-ID: <000e01bfa922$03466330$a20efea9@indus> From: "ty" To: Subject: DEFAULT now() ? Date: Tue, 18 Apr 2000 10:36:53 -0000 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_000B_01BFA922.0335C160" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 X-Archive-Number: 200004/67 This is a multi-part message in MIME format. ------=_NextPart_000_000B_01BFA922.0335C160 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable May someone please show me the necessary code snippets that would allow the= value of a column to take the current time ( ala now() ) by default on INS= ERT? Indicative example: CREATE TABLE foo ( a INTEGER NOT NULL DEFAULT 0, b DATETIME NOT NULL DEFAULT now() ); INSERT INTO foo (a) VALUES (123); What happens here? Well, a row is inserted into table ``foo'' where ``a'' h= as the value 123 and b holds the date & time of when the create DDL stateme= nt was executed. I'm wondering how to get b to have the value of the time w= henever any arbitrary insert statement is executed... Ty ------=_NextPart_000_000B_01BFA922.0335C160 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
May someone please show me the necessary c= ode=20 snippets that would allow the value of a column to take the current ti= me (=20 ala now() ) by default on INSERT?
 
Indicative example:
 
CREATE TABLE foo (
    a INTEGER NOT NULL DEFA= ULT=20 0,
    b DATETIME NOT NULL DEF= AULT=20 now()
);
 
INSERT INTO foo (a) VALUES (123);
 
What happens here? Well, a row is inserted= into=20 table ``foo'' where ``a'' has the value 123 and b holds the date &= time=20 of when the create DDL statement was executed. I'm wondering how to get b t= o=20 have the value of the time whenever any arbitrary insert statement is=20 executed...
 
Ty
 
------=_NextPart_000_000B_01BFA922.0335C160--