Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> inserts with automatic time stamp
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.
Sybase is much more elegant than Oracle here:
<<
insert into .... values (...., gettime(), ...)
>>
because Sybase has a proper datetime type.
thanks for help and kind regards
Bernd.
--
Bernd Götz goetz_at_tarsec.com TARSEC AG Tel +41 1 496 61 11 Rautistrasse 12 Fax +41 1 496 61 99 8047 Zürich, Switzerland http://www.tarsec.comReceived on Wed Sep 02 1998 - 04:49:47 CDT