Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> inserts with automatic time stamp

inserts with automatic time stamp

From: Bernd Goetz <goetz_at_tarsec.com>
Date: Wed, 02 Sep 1998 11:49:47 +0200
Message-ID: <35ED14BB.658DA52F@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.

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.com

Received on Wed Sep 02 1998 - 04:49:47 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US