Creating User and adding responsibility from back end

/*****************Add User********************/
DECLARE
LC_USER_NAME VARCHAR2(100) := ‘PRAY’;
LC_USER_PASSWORD VARCHAR2(100) := ‘welcome123’;
ld_user_start_date DATE := sysdate;
ld_user_end_date VARCHAR2(100) := NULL;

BEGIN
fnd_user_pkg.createuser
( x_user_name => lc_user_name,
X_OWNER => NULL,
x_unencrypted_password => lc_user_password,
x_start_date => ld_user_start_date,
x_end_date => ld_user_end_date
);

COMMIT;

EXCEPTION
WHEN OTHERS THEN
ROLLBACK;
DBMS_OUTPUT.PUT_LINE(SQLERRM);
END;

 
/********************add responsibility*********************/

DECLARE
lc_user_name VARCHAR2(100) := ‘PRAY’;
lc_resp_appl_short_name VARCHAR2(100) := ‘SYSADMIN’;
lc_responsibility_key VARCHAR2(100) := ‘SYSTEM_ADMINISTRATOR’;
LC_SECURITY_GROUP_KEY VARCHAR2(100) := ‘STANDARD’;
ld_resp_start_date DATE := sysdate;
ld_resp_end_date DATE := NULL;

BEGIN
fnd_user_pkg.addresp
( username => lc_user_name,
resp_app => lc_resp_appl_short_name,
resp_key => lc_responsibility_key,
security_group => lc_security_group_key,
description => NULL,
start_date => ld_resp_start_date,
end_date => ld_resp_end_date
);

COMMIT;

EXCEPTION
WHEN OTHERS THEN
ROLLBACK;
DBMS_OUTPUT.PUT_LINE(SQLERRM);
END;

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s