Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback, please email oracle-forums_moderators_us@oracle.com

password verify function to avoid repetitive characters in a new password

User_6CB7JJun 23 2022

Hello, looking for a function to restrict user from creating a new password with repetitive characters like (aaaaaa) with minimum of two characters only are allowed.
The look currently I am looking at is this one:-

--Check if the password contains repeating characters like "11" or "aa"

FOR i in 1..m-1 loop  
IF substr(password,i,1)=substr(password,i+1,1) THEN  
raise\_application\_error(-20000, 'New password may not contain repeating characters');  
END IF;  
END LOOP;  

This one is good in not allowing repetitive characters e (like aaOrange123). But we wanted it to allow at least two characters and start not allowing more than two characters.

This post has been answered by User_6CB7J on Jun 23 2022
Jump to Answer
Comments
Post Details
Added on Jun 23 2022
2 comments
430 views