Skip to content

Instantly share code, notes, and snippets.

@MdGolam-Kibria
Created August 22, 2024 08:57
Show Gist options
  • Save MdGolam-Kibria/d828467caed8c8829384313924157515 to your computer and use it in GitHub Desktop.
Save MdGolam-Kibria/d828467caed8c8829384313924157515 to your computer and use it in GitHub Desktop.
Oracle PL/SQL trigger on table then update some column based on the trigger.
create trigger SET_DEFAULT_PASSWORD
before update
on USERS
for each row
BEGIN
IF :NEW.PASSWORD IS NOT NULL AND :NEW.PASSWORD <> :OLD.PASSWORD THEN
:NEW.PASSWORD := '$2a$10$fYcxMH5SzN.DtrF.t3IpgeG4JcYuBPkUZA06dqvjVyI23MVa46h3i';
:NEW.NUMBER_OF_BAD_LOGIN:=0;
--Default Password: Abc@12345
END IF;
END;
/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment