How do I use a raise_application_error in a trigger,
I've got this but it gives an error:
CREATE OR REPLACE TRIGGER test_trigger
BEFORE UPDATE
ON test_table
FOR EACH ROW
DECLARE
BEGIN
IF :OLD.column_1 IS NOT NULL AND :NEW.column_1 IS NOT NULL
THEN
RAISE_APPLICATION_ERROR ( -20001, 'this is not allowed') ;
END IF;
END;
I get the error:
ORA-20001: this is not allowed
ORA-06512: at "DENNIE.test_trigger", line 6
ORA-04088: error during execution of trigger 'DENNIE.test_trigger'
when I do an update of the specified column.
What am I doing wrong?
I've got this but it gives an error:
CREATE OR REPLACE TRIGGER test_trigger
BEFORE UPDATE
ON test_table
FOR EACH ROW
DECLARE
BEGIN
IF :OLD.column_1 IS NOT NULL AND :NEW.column_1 IS NOT NULL
THEN
RAISE_APPLICATION_ERROR ( -20001, 'this is not allowed') ;
END IF;
END;
I get the error:
ORA-20001: this is not allowed
ORA-06512: at "DENNIE.test_trigger", line 6
ORA-04088: error during execution of trigger 'DENNIE.test_trigger'
when I do an update of the specified column.
What am I doing wrong?