Re: retrieve old value while executing an update statement

From: Carlos <miotromailcarlos_at_netscape.net>
Date: Tue, 11 Mar 2008 07:01:36 -0700 (PDT)
Message-ID: <923f7715-5713-4822-86ec-6b2cad9bcd19@m34g2000hsc.googlegroups.com>


On 11 mar, 14:42, Michael Austin <maus..._at_firstdbasource.com> wrote:
> 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])

IMHO: TRIGGER + PACKAGE variables should do the work. (:old. values into package variables).

HTH. Cheers.

Carlos. Received on Tue Mar 11 2008 - 09:01:36 CDT

Original text of this message