oracle如何添加责任,ebs 根据一个用户的创建另外一个用户并添加职责

--创建用户

DECLARE

v_user_name VARCHAR2 (100) := upper('&Enter_User_Name');

v_description VARCHAR2 (100) := 'NEW Test User';

BEGIN

fnd_user_pkg.createuser

(x_user_name => v_user_name,

x_owner => NULL,

x_unencrypted_password => '&input_password',

x_session_number => 0,

x_start_date => SYSDATE,

x_end_date => NULL,

x_last_logon_date => NULL,

x_description => v_description,

x_password_date => NULL,

x_password_accesses_left => NULL,

x_password_lifespan_accesses => NULL,

x_password_lifespan_days => NULL,

x_employee_id => NULL,

x_email_address => NULL,

x_fax => NULL,

x_customer_id => NULL,

x_supplier_id => NULL,

x_user_guid => NULL,

x_change_source => NULL

);

COMMIT;

END;

select * from fnd_user a where a.user_name='TEST'

DECLARE

v_user_name      VARCHAR2(100) := upper('&Enter_User_Name');

v_description    VARCHAR2(100) := 'New User';

v_app_short_name VARCHAR2(100);

v_resp_key       VARCHAR2(100);

CURSOR user_cur IS

select a.application_short_name, r.responsibility_key

from fnd_responsibility_vl r, fnd_application_vl a

where r.application_id = a.application_id

and R.responsibility_ID IN

(SELECT RESPONSIBILITY_ID

FROM fnd_user_resp_groups

WHERE USER_ID = '&from_userid'

AND END_dATE IS NULL);

user_rec user_cur%ROWTYPE;

BEGIN

fnd_user_pkg.createuser(x_user_name                  => v_user_name,

x_owner                      => NULL,

x_unencrypted_password       => '&input_password',

x_session_number             => 0,

x_start_date                 => SYSDATE,

x_end_date                   => NULL,

x_last_logon_date            => NULL,

x_description                => v_description,

x_password_date              => NULL,

x_password_accesses_left     => NULL,

x_password_lifespan_accesses => NULL,

x_password_lifespan_days     => NULL,

x_employee_id                => NULL,

x_email_address              => NULL,

x_fax                        => NULL,

x_customer_id                => NULL,

x_supplier_id                => NULL,

x_user_guid                  => NULL,

x_change_source              => NULL);

COMMIT;

OPEN user_cur;

LOOP

FETCH user_cur

INTO user_rec;

EXIT WHEN user_cur%NOTFOUND;

fnd_user_pkg.addresp(username       => v_user_name,

resp_app       => user_rec.application_short_name,

resp_key       => user_rec.responsibility_key,

security_group => 'STANDARD',

description    => NULL,

start_date     => SYSDATE,

end_date       => null);

END LOOP;

CLOSE user_cur;

commit;

END;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值