Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Saving a pre-changed record
trigger
on insert
copy the old record to a log table
<steveeq1_at_earthlink.net> wrote in message
news:83e4os$845$1_at_nnrp1.deja.com...
> I have a philosophical database question for you guys. I am writing a
> simple order system for a company and sometimes, for whatever reason, a
> particular order needs to be changed. ie: item A isn't available, so we
> give item B to the customer instead, or we change the price of a
> particular item, or we lower the shipping costs, etc.
>
> Anyway, the people who handle the orders sometimes need to reference the
> OLD order. Unfortunately, this means I can't simply change the records
> blindly, because I need to save the old records somehow.
>
> Is the best way to handle this is to attach a piece of code before a
> particular record is changed to copy the pre-changed record to a
> different table with the same layout as the order table? That way, all
> the old records are kept into a table somewhere so nothing gets lost.
>
> I would imagine that is the best way to do it, but I may be missing
> something. Do you think the code should exist at the database level or
> the Visual Basic level?
>
> Any ideas or opinions would be great. I don't want to write a lot of
> code and then realize it could have been done a better way.
>
> - Steve
>
> --------------------------------------
> If you want to send me an email, send it to:
> steve{at_sign}tripperjones{dot_com}
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Fri Dec 17 1999 - 14:48:41 CST