|
CodeListing 2: Customer's required reset-password procedure
create procedure
reset_password( p_username in varchar2,
p_password in varchar2)
as
begin
if ( USER='GEORGE' and p_username in
( 'MARY', 'BILL', 'SUE' ) )
then
execute immediate
'alter user ' || p_username ||
' identified by ' || p_password;
else
send_email_to_admin
( 'george trying to change ' || p_username );
raise_application_error
( -20001, 'George, you cannot do that' );
end if;
end;
/
grant execute on reset_password to george;
|