Re: How to prevent data deletion from MySQL table
Calling a non-existent procedure from a Delete Trigger will work, but it's a hack and may have undesirable side-effects, for example if the deletion command occurs in a transaction, all cmds in the transaction will roll back.
The most straightforward method is to withhold DELETE permission for that table from all users except perhaps yourself.
Next alternative will require a bit of code: create a guard table that references the table in a foreign key constraint ...
create table table1guard( table1ID int primary key, foreign key(table1ID) references table1(table1ID);
... and use Triggers to ensure that all table1 primary keys exist in table1guard.
Subject
Written By
Posted
September 22, 2015 01:25PM
September 22, 2015 01:55PM
September 22, 2015 02:16PM
Re: How to prevent data deletion from MySQL table
September 22, 2015 02:55PM
September 22, 2015 03:27PM
September 22, 2015 11:34PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.