Linux Programmer | RHCE | RHCSA

Search This Blog

Friday, 12 November 2021

record delete restriction trigger

DELIMITER $$
CREATE TRIGGER trigger_name
BEFORE DELETE
ON table_name
FOR EACH ROW
BEGIN
    if SUBSTRING_INDEX(USER(),'@',1) NOT IN ('root') THEN
        CALL cannot_delete_error;
    END if;
END
$$

No comments:

Post a Comment

Jupyterhub-kubernetes-setup

  Jupyterhub kubernetes setup Jupyerhub installation with Kubernetes: The setup is done through the official documentation - http...