Question

Suppose that I want to delete a user named 'abc cba' from the database. So I run the following query:

DELETE FROM table WHERE fname = 'abc' AND last name = 'cba'; commit;

Now, there can be more users with this name I do not know about. The obvious choice would be to run select statement beforehand and check if I am deleting what I really wanted to delete, but I am still human and I can forget that and end up searching for backups to retrieve lost data.

My question is: is there a way to impose certain rules on statements after which they will not execute the DML statement (for example, do not execute the delete if the number of rows deleted exceeds certain threshold)?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top