ebs 根据一个用户的创建另外一个用户并添加职责
2016-06-02 10:19
489 查看
--创建用户
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;
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;
相关文章推荐
- 基于 Red Hat 的发行版 Oracle Linux 正式发布Oracle Linux 7.1
- Oracle Containers for J2EE远程安全漏洞(CVE-2014-0413)
- Oracle 10g R2不能使用EM的问题
- 表空间操作
- PreparedStatement中in子句的处理
- VMware下RedHat4.8_64位安装Oracle 10g RAC--简略脚本
- oracle sql日期比较
- 基于 Red Hat 的发行版 Oracle Linux 正式发布Oracle Linux 7.1
- OS block size和Oracle block size,查找OS Blocksize的方法
- oracle中创建数据库和表空间的几点总结
- 数据库自动备份脚本
- oracle的nvl函数的使用介绍
- 解决oracle用户连接失败的解决方法
- oracle的一些tips技巧
- Oracle 下的开发日积月累
- Oracle存储过程之数据库中获取数据实例
- Windows下ORACLE 10g完全卸载的方法分析
- Oracle 函数大全[字符串函数,数学函数,日期函数]第1/4页
- ORACLE LATERAL-SQL-INJECTION 个人见解