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 -> Re: saving username and sysdate on insert/update

Re: saving username and sysdate on insert/update

From: Chris Hamilton <ToneCzar_at_erols.com>
Date: Mon, 19 Apr 1999 18:46:49 GMT
Message-ID: <371b7880.23457670@news.erols.com>


On Mon, 19 Apr 1999 18:36:14 GMT, jmodic_at_src.si (Jurij Modic) wrote:

>On Mon, 19 Apr 1999 12:40:50 GMT, ToneCzar_at_erols.com (Chris Hamilton)
>wrote:
>
>>On insert, you don't need the trigger at all. Just set the DEFAULT
>>value of the column to the value:
>>
>>alter table X modify (adddte default sysdate, addusr default
>>rtrim(user));
>>
>>Note you should use rtrim(user) instead of simply the pseudo-column
>>"user", since this column is blank-padded out to 30 characters.
>
>On which release is this true? I've been using the "DEFAULT user"
>without any RTRIM on several different releases and haven't noticed
>the behaviour you described. I got a bit worried, so I just performed
>a test on Personal Oracle 7.3.2: ...

I just tested the same on 8.0.5, and as you demonstrate, it seems to have "gone away". I certainly saw the behaviour on Oracle 7.0 and 7.1 (and I believe on 6 as well) -- I discovered it while writing an audit trail application a good while back and it just carried forward. I haven't used this particular function for a couple of years now, so perhaps they've addressed that "bug".

I don't have access to the older versions anymore so I can't verify, but if memory serves, it was a real thing at one time.

Good - makes things simpler!

Chris



Christopher Hamilton
Oracle DBA -- Wall Street Sports
chris_at_wallstreetsports.com
http://www.wallstreetsports.com/ Received on Mon Apr 19 1999 - 13:46:49 CDT

Original text of this message

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