Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Mutating Triggers in Oracle
I did it thusly.
Created a type that is the record I want.
Created a table of that type. (in a package)
Procedures in the package
Clear table
Add a record to the table (this table is in memory)
Write the in memory table to where ever I wanted it.
In the before statement trigger on table A I clear and initialize the table
of the type.
In the after row trigger I fill up the table of type with records.
In the after statement trigger I write the information from the table of
type records to wherever I wanted.
Jim
"Marcelo Vinagreiro" <mlv_2001_at_terra.com.br> wrote in message
news:2cc92fd4.0304291918.7f6e014d_at_posting.google.com...
> Hi,
>
> I've needed to implement a mutating trigger in Oracle.
>
> Thus, I followed the 3 default steps:
>
> 1. I created a package structure which keeps a temporary table;
>
> 2. One row trigger that populates the temporary table that was
> implemented. This one has the "for each row..." statement.
>
> 3. And I created a statement trigger which has the logic I need. So,
> it is possible to perform selects in the same table which has been
> triggered.
>
> All works fine, but I realized a problem: the temporary
> table generated by my package doesn't seem to be cleaned... So, there
> were repetitions... Is there any way to clean the package after an
> execution of the statement trigger (described in 3) ?
>
> Best regards!
>
> Marcelo
Received on Tue Apr 29 2003 - 23:42:35 CDT
![]() |
![]() |