I have this trigger:
create or replace
TRIGGER Trigger_X
before INSERT ON THING
FOR EACH ROW
DECLARE
V_NEWTHING VARCHAR2(20);
BEGIN
NEW_THING('THING'||:old.CDTHING, V_NEWTHING);
UPDATE THING
SET NUMBERTHING = V_NEWTHING
WHERE :new.CDTHING = :old.CDTHING;
end;
But this code is not working - it does not show errors on compiling, but it won't update THING.
More details: At the line NEW_THING, is the stored procedure. It is returning a V_NEWTHING, that is basically a code to be inserted on the THING. But this code simply does not run, and ORA returns this:
ORA-04092: cannot COMMIT in a trigger ORA-06512: at "MYDATABASE.NEW_THING", line 33 ORA-06512: at "MYDATABASE.Trigger_X", line 4
How can i solve this problem? I am fairly new to Oracle.