While deleting record it should not allow to delete and also we need to avoid the oracle errors which was given after trigger
create or replace TRIGGER trigger_name
BEFORE DELETE ON table_name
for each row
begin
if :old.<column_name> is not null then
RAISE_APPLICATION_ERROR
(-20001,'Records cannot be deleted for <table name> table');
end if;
end;
But, while deleting the records getting below errors, even when we add where condition in delete query as <column_name>
Error information:
ORA-20001: Records cannot be deleted for <table name> table
ORA-06512: at "<trigger_name>", line 2
ORA-04088: error during execution of trigger <trigger_name>
Can you let me know how to resolve this trigger issue. Thanks in advance.