DECLARE
l_jtf_person_id NUMBER; /*Assign Value*/
lc_resource_id jtf_rs_resource_extns.resource_id%TYPE;
ln_role_id NUMBER;
lc_role_code VARCHAR2 (200);
l_return_status VARCHAR2 (1);
l_msg_count NUMBER;
l_msg_data VARCHAR2 (5000);
BEGIN
BEGIN
SELECT resource_id
INTO lc_resource_id
FROM apps.jtf_rs_resource_extns
WHERE source_id = l_jtf_person_id;
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line ( 'Unable to find Resource Id for Person ID'
|| l_jtf_person_id
|| SQLERRM
);
END;
BEGIN
SELECT role_id, role_code
INTO ln_role_id, lc_role_code
FROM apps.jtf_rs_roles_b
WHERE role_id =
(SELECT role_id
FROM apps.jtf_rs_roles_tl
WHERE role_name = 'Sales Representative' AND LANGUAGE = 'US');
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line
( 'Unable to find Role Id for Sales Representative'
|| SQLERRM
);
END;
jtf_rs_role_relate_pub.create_resource_role_relate
(p_api_version => 1.0,
p_init_msg_list => 'T',
p_commit => 'T',
p_role_resource_type => 'RS_INDIVIDUAL',
p_role_resource_id => lc_resource_id,
p_role_id => ln_role_id,
p_role_code => lc_role_code,
p_start_date_active => SYSDATE,
p_end_date_active => NULL,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
x_role_relate_id => l_role_relate_id
);
COMMIT;
DBMS_OUTPUT.put_line
( 'JTF Role Relation Created for Sales Representative '
|| l_role_relate_id
);
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line
( 'Error in JTF Role Relation creation for Sales Representative '
|| SQLERRM
);
END;
l_jtf_person_id NUMBER; /*Assign Value*/
lc_resource_id jtf_rs_resource_extns.resource_id%TYPE;
ln_role_id NUMBER;
lc_role_code VARCHAR2 (200);
l_return_status VARCHAR2 (1);
l_msg_count NUMBER;
l_msg_data VARCHAR2 (5000);
BEGIN
BEGIN
SELECT resource_id
INTO lc_resource_id
FROM apps.jtf_rs_resource_extns
WHERE source_id = l_jtf_person_id;
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line ( 'Unable to find Resource Id for Person ID'
|| l_jtf_person_id
|| SQLERRM
);
END;
BEGIN
SELECT role_id, role_code
INTO ln_role_id, lc_role_code
FROM apps.jtf_rs_roles_b
WHERE role_id =
(SELECT role_id
FROM apps.jtf_rs_roles_tl
WHERE role_name = 'Sales Representative' AND LANGUAGE = 'US');
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line
( 'Unable to find Role Id for Sales Representative'
|| SQLERRM
);
END;
jtf_rs_role_relate_pub.create_resource_role_relate
(p_api_version => 1.0,
p_init_msg_list => 'T',
p_commit => 'T',
p_role_resource_type => 'RS_INDIVIDUAL',
p_role_resource_id => lc_resource_id,
p_role_id => ln_role_id,
p_role_code => lc_role_code,
p_start_date_active => SYSDATE,
p_end_date_active => NULL,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
x_role_relate_id => l_role_relate_id
);
COMMIT;
DBMS_OUTPUT.put_line
( 'JTF Role Relation Created for Sales Representative '
|| l_role_relate_id
);
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line
( 'Error in JTF Role Relation creation for Sales Representative '
|| SQLERRM
);
END;
Nice blog, thanks for sharing this informative article.
ReplyDeleteOracle Fusion HCM Online Training
Oracle Fusion SCM Online Training
Oracle Fusion Financials Online Training
Big Data and Hadoop Training In Hyderabad