Re: retrieve old value while executing an update statement
From: Michael Austin <maustin_at_firstdbasource.com>
Date: Tue, 11 Mar 2008 08:42:31 -0500
Message-ID: <qZvBj.110$qS5.5@nlpi069.nbdc.sbc.com>
>
>
> with before insert trigger.... you can "copy" the data to another table
> return it in dbms output statements -etc. A quick google search for
> oracle before insert trigger should give you sufficient examples of how
> this can be done.
Date: Tue, 11 Mar 2008 08:42:31 -0500
Message-ID: <qZvBj.110$qS5.5@nlpi069.nbdc.sbc.com>
Michael Austin wrote:
> codadilupo wrote:
>> Is there a way to retrieve the old value of a column inside an UPDATE >> statement without executing a SELECT first? >> >> Something like: >> >> update x set name='my new name' returning old name into old_name ; >> >> (Oracle 10.2.0.3) >> >> Thank you. Kind regards, C.
>
>
> with before insert trigger.... you can "copy" the data to another table
> return it in dbms output statements -etc. A quick google search for
> oracle before insert trigger should give you sufficient examples of how
> this can be done.
or more pointedly - use a TRIGGER.. ([before/after] [insert/update/delete]) Received on Tue Mar 11 2008 - 08:42:31 CDT