I have a table named users in which there is accountlocked field ... the possible values of that field are Y and N ... if the user from frontend logs in with 3attempts of wrong password then accountlocked will be Y which means account is locked... but I have a specific user that I don’t want the accountlocked to be updated to Y... I created a trigger which can update it to N once it is Y... but I just don’t want the field to be updated to Y atall in the first for that specific user
CREATE OR REPLACE TRIGGER traccountunlock AFTER
UPDATE OF accountlocked ON users
FOR EACH ROW
WHEN (new.username=‘Testuser ’)
BEGIN
IF :new.accountlocked = 'Y' THEN
UPDATE users
SET
accountlocked = 'N'
WHERE
username IN (
'Testuser'
);
END IF;
END;
This works but it does it after the field is updated to Y,but I don’t want it to update to Y at the first place something like instead of ... but instead of works only for views not tables in oracle
Note: I can do it through java code but, I’m not looking for that solution as it needs deploy and future issues