Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Are PL/SQL tables transaction safe?
I am writing triggers to update history tables and have encountered the
dreaded 'mutating table' error. To get around that, I have created a
package with variables, a row trigger to save the key and a statement
trigger to affect the changes.
My question is about the PL/SQL package variables. I am using a counter to index the variables. At the first execution of the row trigger, I set it to 1. If multiple rows are affected, I increment the counter. In the statement trigger, I loop through, do my work and reset the index to 0.
Is this safe within a transaction? Can these package variables be accessed concurrently by more than one trigger? The only code against these variables is in the trigger.
I have scoured the Oracle doco and haven't come up with any definitive explanation. Can anyone help me answer this?
Thanks. Received on Thu May 21 1998 - 10:51:19 CDT