Thread: timestamp

timestamp

From
"Brian Ward"
Date:
How do I create a time stamp column in a table that default to the current
time
when a row is inserted?
I tried putting in now() as the default but I have something wrong
with the syntax or something I think
Any one have an example of a table creation script that has a timestamp
column?




Re: timestamp

From
"Brian Ward"
Date:
I think I got it but I'm not sure if it's correct.
I put the default as CURRENT_TIMESTAMP but I though I had read that was
being taken out and only now was supported?

Does anyone know?

"Brian Ward" <brian0@verizon.net> wrote in message
news:anphrb$24se$1@news.hub.org...
> How do I create a time stamp column in a table that default to the current
> time
> when a row is inserted?
> I tried putting in now() as the default but I have something wrong
> with the syntax or something I think
> Any one have an example of a table creation script that has a timestamp
> column?
>
>




Re: timestamp

From
Larry Rosenman
Date:
On Sun, 2002-10-06 at 09:41, Brian Ward wrote:
> How do I create a time stamp column in a table that default to the current
> time
> when a row is inserted?
> I tried putting in now() as the default but I have something wrong
> with the syntax or something I think
> Any one have an example of a table creation script that has a timestamp
> column?
"comment_timestamp" timestamp(0) with time zone DEFAULT now()

that's a live one from a table I have.


-- 
Larry Rosenman                     http://www.lerctr.org/~ler
Phone: +1 972-414-9812                 E-Mail: ler@lerctr.org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749



Re: timestamp

From
Dan Langille
Date:
On Sun, 6 Oct 2002, Brian Ward wrote:

> How do I create a time stamp column in a table that default to the current
> time
> when a row is inserted?
> I tried putting in now() as the default but I have something wrong
> with the syntax or something I think
> Any one have an example of a table creation script that has a timestamp
> column?

When you have an example which does not do what you want, it is better to
provide that so we can see how to correct it.

I am using : firstlogin   timestamp  default current_timestamp




Re: timestamp

From
Dan Langille
Date:
On Sun, 6 Oct 2002, Brian Ward wrote:

And Brian, since this *is* a mailing list, it would be polite to use a
valid email address.  I suggest that you either unsubscribe or fix the
email address.

Mail to brian0@verizon.net bounces with the message: '550 Invalid
recipient: <brian0@verizon.net>'.