Update trigger in oracle on updating a column

I want to make a trigger that will update a record in a Oracle 8.1.7.4.0 table. (just example code) Error messages I get: ORA-06512: at stringline string Cause: Backtrace message as the stack is unwound by unhandled exceptions.So if if update field A on this (single) record, the same value must be copied over to field B. Action: Fix the problem causing the exception or write an exception handler for this condition.

It does not "see" the new record because the record has not been committed so the update comes back with 0 rows updated.It might be better include the logic in the trigger itself. It does not "see" the new record because the record has not been committed so the update comes back with 0 rows updated.It might be better include the logic in the trigger itself.you should do this: create or replace trigger Trig On Test1 BEFORE -- before instead of after insert or update on mytest1 referencing OLD as old NEW as new for each row begin if :new.col1 = 100 then :new.col3 := 500; -- set value here end if; end; Hi, it would be much easier to do it all in a single trigger.Use the WHEN clause to prevent the trigger from firing for every insert and update. create or replace trigger Trig On Test1 BEFORE insert or update on mytest1 referencing OLD as old NEW as new for each row WHEN (new.col1 = 100) begin :new.col3 = 500; end; Brian you can call any number of procedure, but instead of updating/inserting inside of these procedures, they should be returning values back to the trigger and then you populate these values into :new.column thx you can use before insert or update trigger, something like this create or replace trigger TRBIU_Test Employees before insert or update on Employees referencing OLD as old NEW as new for each row WHEN (new.employee_id = 1001) begin :new.email := [email protected]'; end; Hope this would help!After that, you can just set the :new.[column name] values and allow the driving transaction to perform it's own commit or rollback. Nidhi In that case won't it become mutating trigger because i will be updating in the trigger which will aging fire the trigger and so on.