If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

This table contains 1lack records.
here user passwords contain alpha numeric.
we like to change all old users passwords
and new users as 4 digit numeric password.
So,I need a stord procedure by check the old passwords when
they login and convert that one into numeric.

create or replace
trigger cng_password
after logon on database
begin
if user not in ('SYS', 'SYSTEM') then
if not pwd_change(user) then
-- this in not modno user
null;
else
-- this in mobno user (password changed)
null;
end if;
end;
/

/*both the password fields for the newuser will be filled with the new password*/
update MOBUSER set password = substr(to_char(n),1,4)
password1 = substr(to_char(n),1,4) ,
status = 'NEW' where mobno = p_mobno;

update MOBUSER set password1 = substr(to_char(n),1,4)
status = 'CHANGE' where mobno = p_mobno;
/*if you want update the same new password for firstpassword field also or else the old password will be maintained inthe first password field*/

set mob_pwd: =substr(to_char(n),1,4) ;
set status='CHANGE';

end if;
if length(rtrim(rm.password))=4 then

set mob_pwd: =rm.password;/*same password is returned*/
set status='NoCHANGE';

end if

end if

end;

Good Judgement comes from Experience.
Experience comes from Bad Judgement