Say you have a procedure which inserts/updates records.
And you want to do this after a row is updated in a table in oracle.
Now you create a trigger and call this procedure. But it fails because Oracle throws an error saying "Commit - not allowed in a trigger".
The solution for this is to use the following :
create or replace myprocedure is
pragma AUTONOMOUS_TRANSACTION;
begin
...
do stuff
...
end;
And that should take care of it.
No comments:
Post a Comment