Re: Triggers

From: <>
Date: Thu, 26 Feb 2009 19:19:14 +0100
Message-ID: <>

On Thu, 26 Feb 2009 09:01:50 -0800 (PST), "" <> wrote:

>We are making some changes and I'd like to know if this can be done
>with a trigger.
>I have Table1 which is the master table and Table2 which is the
>history table. Currently we have over 100 places where Table1 is
>inserted to and deleted from. After that Table2 is dealt with.
>The table structures are a bit different and a couple of the columns
>in Table2 come from stored procedure variables.
>What we want it to put a trigger one Table1 to do the insert into
>Table2 for us. This will fix any chances that Table1 is changed
>without Table2 being changed also.
>Since Table2 has a different structure and 2 columns come from
>procedure variables, how can I access those variables?
>We do not want to go to 100 places and update everything. Also, this
>does away with the trigger and the tables can become out of sync....

Put the 'procedure variables' or whatever they may be, in a package spec, and write a get_<variable> function to retrieve them, and a put>_<variable> procedure to assign them. Pretty basic stuff.


Sybrand Bakker
Senior Oracle DBA
Received on Thu Feb 26 2009 - 12:19:14 CST

Original text of this message