I am trying to have my package display errors that are returned by a function. Here is the if stmt that checks:
if substr(SQLERRM,1,9) in ('ORA-20003', 'ORA-20001','ORA-20002', 'ORA-20004') then
SQL_LIB.SET_MARK('OPEN',
'C_GET_CML_PASSWORD_NOT_PASS',
'RTK_ERRORS',
NULL);

open C_GET_CML_PASSWORD_NOT_PASS;
fetch C_GET_CML_PASSWORD_NOT_PASS into L_error_message;
close C_GET_CML_PASSWORD_NOT_PASS;

O_error_message := L_error_message;
return FALSE;
end if;
and it sort of works but the error I get, for example if I only give 5 characters and the password is supposed to be at least 6 is:
Error ORA-28003: password verification for the specified password failed
ORA-20002:Password length less than 6 returned by program unit PASSWORD_CHG.CHG_PASSWORD
when the error I would like to see is: Password did not pass validation. Password was not changed.