Does not not special characters in the password

Here's the function I used to apply the oracle password. I can able to use all the numbers, characters, but when I use special as cat (punctarray: ='!) » #$% & ()'' * +,-/ : ; <>=? _';) I can able to use only the characters # when I'm with all the other amazing it gives me an error


SQL > alter user u1 identified by nira86 #* wad456j;
change the u1 user identified by nira86 #* wad456j
*
ERROR on line 1:
ORA-00922: missing or not valid option



Here's the function

FUNCTION to CREATE or REPLACE verify_function
(username varchar2,
password varchar2,
VARCHAR2 old_password of past)
RETURNS boolean IS
Boolean n;
whole m;
different integer;
Boolean IsDigit;
because Boolean;
ispunct Boolean;
digitarray varchar2 (20);
punctarray varchar2 (25);
CharArray varchar2 (52);

BEGIN
digitarray: = "0123456789";
CharArray: = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ';
punctarray: ='! » #$% & ()'' * +,-/ : ; <>=? _';

-Check if the password is the same as the user name
IF (password) NLS_LOWER = NLS_LOWER (username) THEN
raise_application_error ("-20001, ' identical or similar to the user password");
END IF;

-The minimum length of the password checking
IF (password) length < 15 THEN
raise_application_error (-20002, 'length of less than 15 password');
END IF;

-Check if the password is too simple. A dictionary of words can be
-maintained and can be verified so does not allow the words
-which are too simple for the password.
IF NLS_LOWER (password) IN ('Welcome', 'database', 'account', 'user', 'password', 'oracle', 'PC', 'abcd') THEN
raise_application_error ('-20002, ' simple password ');
END IF;

-Check if the password contained at least a letter, a number and a
-punctuation mark.
-- 1. Check for the digit
IsDigit: = FALSE;
m: = length (password);
FOR I IN 1.10 LOOP
FOR j IN LOOP 1.m
IF substr (password, j, 1) = substr(digitarray,i,1) THEN
IsDigit: = TRUE;
GOTO findchar;
END IF;
END LOOP;
END LOOP;
IF IsDigit = FALSE THEN
raise_application_error (-20003, 'password must contain at least one digit, a character and a punctuation');
END IF;
-- 2. Check the character
< < findchar > >
car: = FALSE;
FOR i IN 1.length (chararray) LOOP
FOR j IN LOOP 1.m
IF substr (password, j, 1) = substr(chararray,i,1) THEN
car: = TRUE;
GOTO findpunct;
END IF;
END LOOP;
END LOOP;
Because IF = FALSE THEN
raise_application_error (-20003, ' password must contain at least one------)
Figure, a character and a punctuation ');
END IF;
-- 3. Search for punctuation
< < findpunct > >
ispunct: = FALSE;
FOR i IN 1.length (punctarray) LOOP
FOR j IN LOOP 1.m
IF substr (password, j, 1) = substr(punctarray,i,1) THEN
ispunct: = TRUE;
GOTO endsearch;
END IF;
END LOOP;
END LOOP;
Ispunct IF = FALSE THEN
raise_application_error (-20003, ' password must contain at least one------)
Figure, a character and a punctuation ');
END IF;

< < endsearch > >
-Check if the password is different from the previous password at least
-3 letters
Old_password past IF IS NOT NULL THEN
differ: = length (old_password) - length (password);

IF abs (differ) < 3 THEN
IF (password) length < length (old_password) THEN
m: = length (password);
ON THE OTHER
m: = length (old_password);
END IF;

differ: = abs (differ);
I'm IN 1.m LOOP
IF substr (password, i, 1). = substr(old_password,i,1) THEN
differ: = differ + 1;
END IF;
END LOOP;

IF different < 3 THEN
raise_application_error (-20004, ' password should differ by to)
(minimum 3 characters);
END IF;
END IF;
END IF;
-Everything all right; Return TRUE;
RETURN (TRUE);
END;
/

What version of Oracle are you using? Before 11 g I think only allowed special characters were '_', ' $' and ' # '.

And 11 g, you need to put the password in quotation marks and must not use comma, backslash or double quote.

Tags: Database

Similar Questions

Maybe you are looking for