Home > database >  Use a trigger to prevent delete table
Use a trigger to prevent delete table

Time:10-07

Latest received a way to stop using triggers the demands of the table delete baidu to find the following code changes after running

The create or replace the trigger preventdeleted502
Before the delete on d502_mzdetail
For each row
The begin
If deleting then raise_application_error (- 200001 'is not allowed to delete the data! ');
Dbms_output. PUT_LINE (' is not allowed to delete the data! ');
end if;
end;


Excuse me each warrior by the trigger behind how to modify don't suggest abnormal and statements can continue to perform or have other method to reference

CodePudding user response:

Alternatively, a journal on plug back

CodePudding user response:

To what the trigger, the user directly to delete this table, to get rid of, cannot be deleted

CodePudding user response:

Change the name of the table into a view, used to replace the trigger,
  • Related