EBS批量修改前台帐户密码

/*根据fnd_user表,建一张相同表结构的cux_fnd_user的客户化的表,然后把需要批量修改的表导入cux_fnd_user*/
declare
  l_ret boolean;

  cursor c_u is
    select fu.user_num user_name
      from cux_fnd_user fu
     where fu.ebs_user = 'Y'
     --and fu.user_num='8770129'
     ;
     l_pwd varchar2(25);
begin
  for rec in c_u loop
    l_pwd:= dbms_random.string('x', 25);/*生成随机的密码25位*/
    dbms_output.put_line('user_name:'||rec.user_name||',pwd:'||l_pwd);
    l_ret := fnd_user_pkg.ChangePassword(rec.user_name,l_pwd
                                        );
    if not l_ret then
      app_exception.raise_exception(exception_text => '修改用户' ||
                                                      rec.user_name ||
                                                      '密码错误' ||
                                                      cux_debug.get_error_stack);
    end if;
  end loop;
end;

猜你喜欢

转载自blog.csdn.net/lzl1101206656/article/details/80763168