From: Guo Bin <guobin_@yahoo.com>
To: Ang Sei Heng <joanna@leopard.cybersource.com.sg>
To: pgsql-sql@postgresql.org
Subject: Re: Help on some SQL command...
Date: Thu, 17 Aug 2000 01:59:17 -0700 (PDT)
Message-ID: <20000817085917.12557.qmail@web204.mail.yahoo.com> (raw)
Hi,
You can specify a default value for the create_date
column like:
create_date timestamp default 'now'
In the insert statement just ommit that field and you
will get the default, as
insert into test1 (id, name) values (1, 'xxx');
Regards,
--
Guo Bin
--- Ang Sei Heng <joanna@leopard.cybersource.com.sg> wrote:
> Hello to all the SQL gurus...
>
> I have this little table:
>
> test1 (
> id char(8) primary key,
> name char(20),
> create_date timestamp
> );
>
> Now, the create_date need to be updated
> to date and time whenever id is being
> inserted or updated.
>
> Is there a way in SQL that I can do this
> automatically?
__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: guobin_@yahoo.com, joanna@leopard.cybersource.com.sg
Subject: Re: Help on some SQL command...
In-Reply-To: <20000817085917.12557.qmail@web204.mail.yahoo.com>
References: <20000817085917.12557.qmail@web204.mail.yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox