Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: inserts with automatic time stamp
Bernd Goetz wrote in message <35ED14BB.658DA52F_at_tarsec.com>...
>Hi
>
>I've got a log table in which I also want to store the current date and =
time. I do it like this:
>
><<
>insert into applog (pname, pversion, type, userid, created, msg)
> values ('PL', '0.9.0', 'LOGON', 'bgo',
> to_date(to_char(sysdate, 'MM/DD/YYYY HH24:MI:SS'), 'MM/DD/YYYY =
HH24:MI:SS'),
> 'by hand')
>>>
>
>I didn't find another way of solving this. What do you think? Did I =
miss something? btw: this is
>important: I want to keep the database format as independent from any =
specialities of Oracle as
>possible. Hence no special purpose current time data types are allowed.
[...]
Maybe someone with more knowledge of the SQL standard can comment, but, =
I think everything used to populate the 'created' column is specific to =
Oracle (hence, special purpose).
--
Barry L. Wallis, Senior Systems Engineer
Science Applications International Corporation
4161 Campus Point Court
San Diego, CA 92121
voice: (619) 646-9891, fax: (619) 646-9327 mailto: Barry.L.Wallis_at_cpmx.saic.com