1
I’m trying to create a sequence
in a trigger
.
When trying to create by Execute Immediate
, I’m getting the following feedback:
ORA: 4092 - Cannot commit in a Trigger.
For all I’ve researched, use the Execute Immediate
in a Trigger is not possible as he is in a dll
that issues a commit
automatic.
I wonder if there is any other way to create a Quence for a Rigger.
Follow the code of Trigger
CREATE OR REPLACE TRIGGER "TR_TEST"
AFTER UPDATE ON TEST_TABLE
FOR EACH ROW
DECLARE
BEGIN
BEGIN
EXECUTE IMMEDIATE 'CREATE SEQUENCE SEQ01' ||
' MINVALUE 1' ||
' MAXVALUE 999999999999999999999999999' ||
' START WITH 1' ||
' INCREMENT BY 1' ||
' NOCACHE';
EXCEPTION
WHEN OTHERS THEN
RAISE_APPLICATION_ERROR(-20200, 'Error');
END;
END
Include the code of your attempt
– Leandro Angelo
I edited and entered the code
– Júnior