69: CURSOR c_res_list_csr IS
70: SELECT
71: group_resource_type_id
72: FROM
73: pa_resource_lists_all_bg
74: WHERE resource_list_id = p_resource_list_id;
75:
76: CURSOR c_res_list_member_csr_1 IS
77: SELECT 'x'
154: BEGIN
155: l_old_stack := p_err_stack;
156: p_err_code := 0;
157: p_err_stack := p_err_stack ||'->PA_CREATE_RESOURCE.create_resource_group';
158: p_err_stage := ' Select group_resource_type_id from pa_resource_lists';
159:
160: -- Get Resource List Id ,Group_resource_type_id from
161: -- PA_RESOURCE_LISTS with the
162: -- X_Resource_list_id.
157: p_err_stack := p_err_stack ||'->PA_CREATE_RESOURCE.create_resource_group';
158: p_err_stage := ' Select group_resource_type_id from pa_resource_lists';
159:
160: -- Get Resource List Id ,Group_resource_type_id from
161: -- PA_RESOURCE_LISTS with the
162: -- X_Resource_list_id.
163: OPEN c_res_list_csr;
164: FETCH c_res_list_csr INTO
165: l_resource_type_id;
577: l_resource_list_name Varchar2(60);
578:
579: CURSOR c_res_list_csr IS
580: SELECT 'x' FROM
581: pa_resource_lists
582: WHERE NAME = p_resource_list_name;
583:
584: CURSOR c_res_list_member_seq_csr IS
585: SELECT
605: pa_resource_groups_valid_v
606: WHERE resource_group = p_group_resource_type;
607:
608: CURSOR c_res_list_seq_csr IS
609: SELECT pa_resource_lists_s.NEXTVAL
610: FROM
611: SYS.DUAL;
612:
613: -- Added for Bug 2486405.
632:
633: l_old_stack := p_err_stack;
634: p_err_code := 0;
635: p_err_stack := p_err_stack ||'->PA_CREATE_RESOURCE.create_resource_list';
636: p_err_stage := 'Select x from pa_resource_lists ';
637:
638: -- First clear the message stack if called from html.
639: IF p_migration_code IS NOT NULL THEN
640: FND_MSG_PUB.initialize;
702: CLOSE c_resource_groups_csr;
703: END IF;
704: END IF; -- Added by RM
705:
706: p_err_stage := 'Select pa_resource_lists_s.nextval from dual ';
707: OPEN c_res_list_seq_csr;
708: FETCH c_res_list_seq_csr INTO
709: l_resource_list_id;
710: IF c_res_list_seq_csr%NOTFOUND THEN
734: END IF;
735: End If;
736: -----------------------Bug 2486405--------------------------
737:
738: p_err_stage := 'Insert into pa_resource_lists ';
739:
740: IF (p_job_group_id IS NOT NULL ) OR (p_job_group_name IS NOT NULL) THEN
741: pa_job_utils.Check_Job_GroupName_Or_Id(
742: p_job_group_id => p_job_group_id,
754: END IF;
755: /**************************************************
756: * Bug - 3501039
757: * Desc - taking a substr of the p_resource_list_name
758: * before inserting into the pa_resource_lists_all_bg
759: * table.
760: ************************************************/
761: l_resource_list_name := substr(p_resource_list_name,0,58);
762: INSERT INTO pa_resource_lists_all_bg (
758: * before inserting into the pa_resource_lists_all_bg
759: * table.
760: ************************************************/
761: l_resource_list_name := substr(p_resource_list_name,0,58);
762: INSERT INTO pa_resource_lists_all_bg (
763: resource_list_id,
764: name,
765: business_group_id,
766: description,
805: );
806:
807: /* commented for bug 6079140 IF p_migration_code = 'N' THEN -- Added by RM */
808: -- New lists - insert into TL table
809: insert into pa_resource_lists_tl (
810: LAST_UPDATE_LOGIN,
811: CREATION_DATE,
812: CREATED_BY,
813: LAST_UPDATE_DATE,
831: from FND_LANGUAGES L
832: where L.INSTALLED_FLAG in ('I', 'B')
833: and not exists
834: (select NULL
835: from pa_resource_lists_tl T
836: where T.RESOURCE_LIST_ID = L_RESOURCE_LIST_ID
837: and T.LANGUAGE = L.LANGUAGE_CODE);
838:
839: /* commented for bug 6079140 END IF; -- Adding to TL */
1063: --Using pa_resource_list_assignments_v instead of
1064: --pa_resource_list_assignments.
1065: CURSOR chk_wp_disable IS
1066: SELECT 'N'
1067: FROM pa_resource_lists_all_bg rl
1068: WHERE rl.resource_list_id = p_resource_list_id
1069: AND rl.use_for_wp_flag <> p_use_for_wp_flag
1070: --AND exists (select 'Y' from pa_resource_list_assignments rla
1071: AND exists (select 'Y' from pa_resource_list_assignments_v rla
1076: --Using pa_resource_list_assignments_v instead of
1077: --pa_resource_list_assignments.
1078: CURSOR chk_ctrl_changed IS
1079: SELECT 'N'
1080: FROM pa_resource_lists_all_bg rl
1081: WHERE rl.resource_list_id = p_resource_list_id
1082: AND rl.control_flag <> p_control_flag
1083: --AND exists (select 'Y' from pa_resource_list_assignments rla
1084: AND exists (select 'Y' from pa_resource_list_assignments_v rla
1091: AND job_id IS NOT NULL;
1092:
1093: CURSOR get_job_group_id IS
1094: SELECT job_group_id
1095: FROM pa_resource_lists_all_bg
1096: WHERE resource_list_id = p_resource_list_id;
1097:
1098: /********************************************
1099: * Bug : 3473679
1102: * the database.
1103: ********************************************/
1104: CURSOR get_wp_flag IS
1105: SELECT use_for_wp_flag
1106: FROM pa_resource_lists_all_bg
1107: WHERE resource_list_id = p_resource_list_id;
1108:
1109: CURSOR chk_migrated_list IS
1110: SELECT 'N'
1107: WHERE resource_list_id = p_resource_list_id;
1108:
1109: CURSOR chk_migrated_list IS
1110: SELECT 'N'
1111: FROM pa_resource_lists_all_bg rl
1112: WHERE rl.resource_list_id = p_resource_list_id
1113: AND rl.control_flag <> p_control_flag
1114: AND rl.migration_code = 'M';
1115:
1297: close chk_job_group_allow;
1298:
1299: END IF;
1300: --Bug 3501039
1301: update pa_resource_lists_all_bg
1302: set name = substr(nvl(p_resource_list_name, name),0,58),
1303: description = p_description,
1304: job_group_id = p_job_group_id,
1305: start_date_active = nvl(p_start_date, start_date_active),
1323: END IF;
1324:
1325: p_record_version_number := p_record_version_number + 1;
1326:
1327: update pa_resource_lists_tl set
1328: NAME = nvl(p_resource_list_name, name),
1329: DESCRIPTION = P_DESCRIPTION,
1330: LAST_UPDATE_DATE = g_last_update_date,
1331: LAST_UPDATED_BY = g_last_updated_by,
1344: p_resource_list_id IN NUMBER) return BOOLEAN
1345: IS
1346: CURSOR check_plan_rl_unique IS
1347: SELECT 'N' FROM
1348: pa_resource_lists_tl
1349: WHERE NAME = p_resource_list_name
1350: AND LANGUAGE = userenv('LANG')
1351: AND ((resource_list_id <> p_resource_list_id
1352: AND p_resource_list_id IS NOT NULL)
1353: OR p_resource_list_id IS NULL);
1354:
1355: CURSOR check_old_lists IS
1356: SELECT 'N' FROM
1357: pa_resource_lists_all_bg
1358: WHERE NAME = p_resource_list_name
1359: AND ((resource_list_id <> p_resource_list_id
1360: AND p_resource_list_id IS NOT NULL)
1361: OR p_resource_list_id IS NULL);
1696: CURSOR c_resource_lists_csr IS
1697: SELECT
1698: group_resource_type_id
1699: FROM
1700: pa_resource_lists_all_bg
1701: WHERE resource_list_id = p_resource_list_id;
1702:
1703: CURSOR c_resource_types_csr IS
1704: SELECT
1822: p_err_code := 10;
1823: p_err_stage := 'PA_NO_PROJECT_ROLE_ID';
1824: RETURN;
1825: END IF;
1826: p_err_stage := 'Select group_resource_type_id from pa_resource_lists ';
1827: OPEN c_resource_lists_csr;
1828: FETCH c_resource_lists_csr INTO
1829: l_grouped_resource_type_id;
1830: IF c_resource_lists_csr%NOTFOUND THEN
2520: CURSOR c_res_list_csr IS
2521: SELECT
2522: group_resource_type_id
2523: FROM
2524: pa_resource_lists_all_bg
2525: WHERE resource_list_id = p_resource_list_id;
2526:
2527: CURSOR c_resource_types_csr IS
2528: SELECT
2683: BEGIN
2684: l_old_stack := p_err_stack;
2685: p_err_code := 0;
2686: p_err_stack := p_err_stack||'->PA_CREATE_RESOURCE.add_resource_list_member';
2687: p_err_stage := ' Select group_resource_type_id from pa_resource_lists';
2688:
2689: -- Get Resource List Id ,Group_resource_type_id from
2690: -- PA_RESOURCE_LISTS with the
2691: -- X_Resource_list_id.
2686: p_err_stack := p_err_stack||'->PA_CREATE_RESOURCE.add_resource_list_member';
2687: p_err_stage := ' Select group_resource_type_id from pa_resource_lists';
2688:
2689: -- Get Resource List Id ,Group_resource_type_id from
2690: -- PA_RESOURCE_LISTS with the
2691: -- X_Resource_list_id.
2692: OPEN c_res_list_csr;
2693: FETCH c_res_list_csr INTO
2694: l_grouped_resource_type_id;
3342: start_date_active, end_date_active, uncategorized_flag,
3343: control_flag,migration_code,use_for_wp_flag,
3344: last_updated_by, last_update_date, creation_date,
3345: created_by, last_update_login
3346: FROM pa_resource_lists_all_bg
3347: WHERE business_group_id = -3113;
3348:
3349: BEGIN
3350:
3355: X_err_code := 0;
3356: X_err_stack :=
3357: X_err_stack ||'->PA_CREATE_RESOURCE.Create_Default_Res_List';
3358:
3359: X_err_stage := 'Select seeded_resource_list From PA_RESOURCE_LISTS';
3360:
3361: FOR eachRL IN Seeded_RLs LOOP
3362:
3363: X_err_stage := 'Select pa_resource_lists_s.NEXTVAL From Dual';
3359: X_err_stage := 'Select seeded_resource_list From PA_RESOURCE_LISTS';
3360:
3361: FOR eachRL IN Seeded_RLs LOOP
3362:
3363: X_err_stage := 'Select pa_resource_lists_s.NEXTVAL From Dual';
3364:
3365: SELECT pa_resource_lists_s.NEXTVAL
3366: INTO X_resource_list_id
3367: FROM sys.dual;
3361: FOR eachRL IN Seeded_RLs LOOP
3362:
3363: X_err_stage := 'Select pa_resource_lists_s.NEXTVAL From Dual';
3364:
3365: SELECT pa_resource_lists_s.NEXTVAL
3366: INTO X_resource_list_id
3367: FROM sys.dual;
3368:
3369: X_err_stage := 'Insert Into PA_RESOURCE_LISTS';
3365: SELECT pa_resource_lists_s.NEXTVAL
3366: INTO X_resource_list_id
3367: FROM sys.dual;
3368:
3369: X_err_stage := 'Insert Into PA_RESOURCE_LISTS';
3370:
3371: INSERT INTO pa_resource_lists_all_bg (
3372: resource_list_id
3373: , name
3367: FROM sys.dual;
3368:
3369: X_err_stage := 'Insert Into PA_RESOURCE_LISTS';
3370:
3371: INSERT INTO pa_resource_lists_all_bg (
3372: resource_list_id
3373: , name
3374: , business_group_id
3375: , description
3409: FROM
3410: sys.dual
3411: WHERE NOT EXISTS (
3412: SELECT NULL
3413: FROM pa_resource_lists rl
3414: WHERE business_group_id =
3415: NVL(X_business_group_id,
3416: fnd_profile.value('PER_BUSINESS_GROUP_ID'))
3417: AND rl.name = eachRL.name );
3416: fnd_profile.value('PER_BUSINESS_GROUP_ID'))
3417: AND rl.name = eachRL.name );
3418:
3419: --Adding to TL
3420: INSERT into pa_resource_lists_tl (
3421: last_update_login,
3422: creation_date,
3423: created_by,
3424: last_update_date,
3442: FROM FND_LANGUAGES L
3443: WHERE L.INSTALLED_FLAG in ('I', 'B')
3444: and not exists
3445: (select NULL
3446: from pa_resource_lists_tl T
3447: where T.RESOURCE_LIST_ID = X_RESOURCE_LIST_ID);
3448:
3449: X_err_stage := 'Insert Into PA_RESOURCE_LIST_MEMBERS';
3450:
3515: , rlm.UNIT_OF_MEASURE
3516: FROM pa_resource_list_members rlm
3517: WHERE rlm.resource_list_id = eachRL.resource_list_id
3518: --begin:bug:5925973:Implementing the logic to restrict the creation of resource list member records when new OU ('Implementation Options' form of the OU)is created for an existing Business Group.
3519: --The Check:check whether the 'X_RESOURCE_LIST_ID' exists in the 'pa_resource_lists_all_bg' table before inserting records into 'pa_resource_list_members' table
3520: AND EXISTS
3521: (SELECT NULL
3522: FROM pa_resource_lists_all_bg T1
3523: WHERE T1.RESOURCE_LIST_ID = X_RESOURCE_LIST_ID);
3518: --begin:bug:5925973:Implementing the logic to restrict the creation of resource list member records when new OU ('Implementation Options' form of the OU)is created for an existing Business Group.
3519: --The Check:check whether the 'X_RESOURCE_LIST_ID' exists in the 'pa_resource_lists_all_bg' table before inserting records into 'pa_resource_list_members' table
3520: AND EXISTS
3521: (SELECT NULL
3522: FROM pa_resource_lists_all_bg T1
3523: WHERE T1.RESOURCE_LIST_ID = X_RESOURCE_LIST_ID);
3524: --end:bug:5925973
3525: END LOOP;
3526:
3611: delete from pa_plan_rl_formats
3612: where resource_list_id = p_resource_list_id;
3613:
3614: -- Delete the planning resource list - TL
3615: delete from pa_resource_lists_tl
3616: where resource_list_id = p_resource_list_id;
3617:
3618: -- Delete the planning resource list
3619: delete from pa_resource_lists_all_bg
3615: delete from pa_resource_lists_tl
3616: where resource_list_id = p_resource_list_id;
3617:
3618: -- Delete the planning resource list
3619: delete from pa_resource_lists_all_bg
3620: where resource_list_id = p_resource_list_id;
3621:
3622: END Delete_Plan_Res_List;
3623:
3657: **********************************************/
3658: procedure ADD_LANGUAGE
3659: is
3660: begin
3661: delete from pa_resource_lists_tl T
3662: where not exists
3663: (select NULL
3664: from PA_RESOURCE_LISTS_ALL_BG B
3665: where B.RESOURCE_LIST_ID = T.resource_list_id
3660: begin
3661: delete from pa_resource_lists_tl T
3662: where not exists
3663: (select NULL
3664: from PA_RESOURCE_LISTS_ALL_BG B
3665: where B.RESOURCE_LIST_ID = T.resource_list_id
3666: );
3667:
3668: update pa_resource_lists_tl T set (
3664: from PA_RESOURCE_LISTS_ALL_BG B
3665: where B.RESOURCE_LIST_ID = T.resource_list_id
3666: );
3667:
3668: update pa_resource_lists_tl T set (
3669: NAME,
3670: DESCRIPTION
3671: ) = (select
3672: B.NAME,
3670: DESCRIPTION
3671: ) = (select
3672: B.NAME,
3673: B.DESCRIPTION
3674: from pa_resource_lists_tl b
3675: where B.RESOURCE_LIST_ID = T.RESOURCE_LIST_ID
3676: and B.LANGUAGE = T.SOURCE_LANG)
3677: where (
3678: T.RESOURCE_LIST_ID,
3679: T.LANGUAGE
3680: ) in (select
3681: SUBT.RESOURCE_LIST_ID,
3682: SUBT.LANGUAGE
3683: from pa_resource_lists_tl SUBB, pa_resource_lists_tl SUBT
3684: where SUBB.RESOURCE_LIST_ID = SUBT.RESOURCE_LIST_ID
3685: and SUBB.LANGUAGE = SUBT.SOURCE_LANG
3686: and (SUBB.NAME <> SUBT.NAME
3687: or SUBB.DESCRIPTION <> SUBT.DESCRIPTION
3688: or (SUBB.DESCRIPTION is null and SUBT.DESCRIPTION is not null)
3689: or (SUBB.DESCRIPTION is not null and SUBT.DESCRIPTION is null)
3690: ));
3691:
3692: insert into pa_resource_lists_tl (
3693: LAST_UPDATE_LOGIN,
3694: CREATION_DATE,
3695: CREATED_BY,
3696: LAST_UPDATE_DATE,
3710: B.NAME,
3711: B.DESCRIPTION,
3712: L.LANGUAGE_CODE,
3713: B.SOURCE_LANG
3714: from pa_resource_lists_tl B, FND_LANGUAGES L
3715: where L.INSTALLED_FLAG in ('I', 'B')
3716: and B.LANGUAGE = userenv('LANG')
3717: and not exists
3718: (select NULL
3715: where L.INSTALLED_FLAG in ('I', 'B')
3716: and B.LANGUAGE = userenv('LANG')
3717: and not exists
3718: (select NULL
3719: from pa_resource_lists_tl T
3720: where T.RESOURCE_LIST_ID = B.RESOURCE_LIST_ID
3721: and T.LANGUAGE = L.LANGUAGE_CODE);
3722: end ADD_LANGUAGE;
3723: /***************************/
3769:
3770: BEGIN
3771: SELECT Control_flag
3772: INTO l_central_control
3773: FROM pa_resource_lists_all_bg
3774: where resource_list_id = p_resource_list_id;
3775: EXCEPTION
3776: WHEN OTHERS THEN
3777: X_Return_Status := Fnd_Api.G_Ret_Sts_UnExp_Error;
4045: PROCEDURE COPY_RESOURCE_LIST(
4046: P_Commit IN Varchar2 Default Fnd_Api.G_False,
4047: P_Init_Msg_List IN Varchar2 Default Fnd_Api.G_True,
4048: P_API_Version_Number IN Number,
4049: p_parent_resource_list_id IN PA_RESOURCE_LISTS_ALL_BG.resource_list_id%TYPE,
4050: p_name IN PA_RESOURCE_LISTS_ALL_BG.name%TYPE,
4051: p_description IN PA_RESOURCE_LISTS_ALL_BG.description%TYPE,
4052: p_start_date_active IN PA_RESOURCE_LISTS_ALL_BG.START_DATE_ACTIVE%TYPE,
4053: p_end_date_active IN PA_RESOURCE_LISTS_ALL_BG.END_DATE_ACTIVE%TYPE,
4046: P_Commit IN Varchar2 Default Fnd_Api.G_False,
4047: P_Init_Msg_List IN Varchar2 Default Fnd_Api.G_True,
4048: P_API_Version_Number IN Number,
4049: p_parent_resource_list_id IN PA_RESOURCE_LISTS_ALL_BG.resource_list_id%TYPE,
4050: p_name IN PA_RESOURCE_LISTS_ALL_BG.name%TYPE,
4051: p_description IN PA_RESOURCE_LISTS_ALL_BG.description%TYPE,
4052: p_start_date_active IN PA_RESOURCE_LISTS_ALL_BG.START_DATE_ACTIVE%TYPE,
4053: p_end_date_active IN PA_RESOURCE_LISTS_ALL_BG.END_DATE_ACTIVE%TYPE,
4054: p_job_group_id IN PA_RESOURCE_LISTS_ALL_BG.JOB_GROUP_ID%TYPE,
4047: P_Init_Msg_List IN Varchar2 Default Fnd_Api.G_True,
4048: P_API_Version_Number IN Number,
4049: p_parent_resource_list_id IN PA_RESOURCE_LISTS_ALL_BG.resource_list_id%TYPE,
4050: p_name IN PA_RESOURCE_LISTS_ALL_BG.name%TYPE,
4051: p_description IN PA_RESOURCE_LISTS_ALL_BG.description%TYPE,
4052: p_start_date_active IN PA_RESOURCE_LISTS_ALL_BG.START_DATE_ACTIVE%TYPE,
4053: p_end_date_active IN PA_RESOURCE_LISTS_ALL_BG.END_DATE_ACTIVE%TYPE,
4054: p_job_group_id IN PA_RESOURCE_LISTS_ALL_BG.JOB_GROUP_ID%TYPE,
4055: p_control_flag IN PA_RESOURCE_LISTS_ALL_BG.CONTROL_FLAG%TYPE,
4048: P_API_Version_Number IN Number,
4049: p_parent_resource_list_id IN PA_RESOURCE_LISTS_ALL_BG.resource_list_id%TYPE,
4050: p_name IN PA_RESOURCE_LISTS_ALL_BG.name%TYPE,
4051: p_description IN PA_RESOURCE_LISTS_ALL_BG.description%TYPE,
4052: p_start_date_active IN PA_RESOURCE_LISTS_ALL_BG.START_DATE_ACTIVE%TYPE,
4053: p_end_date_active IN PA_RESOURCE_LISTS_ALL_BG.END_DATE_ACTIVE%TYPE,
4054: p_job_group_id IN PA_RESOURCE_LISTS_ALL_BG.JOB_GROUP_ID%TYPE,
4055: p_control_flag IN PA_RESOURCE_LISTS_ALL_BG.CONTROL_FLAG%TYPE,
4056: p_use_for_wp_flag IN PA_RESOURCE_LISTS_ALL_BG.USE_FOR_WP_FLAG%TYPE,
4049: p_parent_resource_list_id IN PA_RESOURCE_LISTS_ALL_BG.resource_list_id%TYPE,
4050: p_name IN PA_RESOURCE_LISTS_ALL_BG.name%TYPE,
4051: p_description IN PA_RESOURCE_LISTS_ALL_BG.description%TYPE,
4052: p_start_date_active IN PA_RESOURCE_LISTS_ALL_BG.START_DATE_ACTIVE%TYPE,
4053: p_end_date_active IN PA_RESOURCE_LISTS_ALL_BG.END_DATE_ACTIVE%TYPE,
4054: p_job_group_id IN PA_RESOURCE_LISTS_ALL_BG.JOB_GROUP_ID%TYPE,
4055: p_control_flag IN PA_RESOURCE_LISTS_ALL_BG.CONTROL_FLAG%TYPE,
4056: p_use_for_wp_flag IN PA_RESOURCE_LISTS_ALL_BG.USE_FOR_WP_FLAG%TYPE,
4057: x_return_status OUT NOCOPY Varchar2,
4050: p_name IN PA_RESOURCE_LISTS_ALL_BG.name%TYPE,
4051: p_description IN PA_RESOURCE_LISTS_ALL_BG.description%TYPE,
4052: p_start_date_active IN PA_RESOURCE_LISTS_ALL_BG.START_DATE_ACTIVE%TYPE,
4053: p_end_date_active IN PA_RESOURCE_LISTS_ALL_BG.END_DATE_ACTIVE%TYPE,
4054: p_job_group_id IN PA_RESOURCE_LISTS_ALL_BG.JOB_GROUP_ID%TYPE,
4055: p_control_flag IN PA_RESOURCE_LISTS_ALL_BG.CONTROL_FLAG%TYPE,
4056: p_use_for_wp_flag IN PA_RESOURCE_LISTS_ALL_BG.USE_FOR_WP_FLAG%TYPE,
4057: x_return_status OUT NOCOPY Varchar2,
4058: x_msg_data OUT NOCOPY Varchar2,
4051: p_description IN PA_RESOURCE_LISTS_ALL_BG.description%TYPE,
4052: p_start_date_active IN PA_RESOURCE_LISTS_ALL_BG.START_DATE_ACTIVE%TYPE,
4053: p_end_date_active IN PA_RESOURCE_LISTS_ALL_BG.END_DATE_ACTIVE%TYPE,
4054: p_job_group_id IN PA_RESOURCE_LISTS_ALL_BG.JOB_GROUP_ID%TYPE,
4055: p_control_flag IN PA_RESOURCE_LISTS_ALL_BG.CONTROL_FLAG%TYPE,
4056: p_use_for_wp_flag IN PA_RESOURCE_LISTS_ALL_BG.USE_FOR_WP_FLAG%TYPE,
4057: x_return_status OUT NOCOPY Varchar2,
4058: x_msg_data OUT NOCOPY Varchar2,
4059: x_msg_count OUT NOCOPY NUMBER
4052: p_start_date_active IN PA_RESOURCE_LISTS_ALL_BG.START_DATE_ACTIVE%TYPE,
4053: p_end_date_active IN PA_RESOURCE_LISTS_ALL_BG.END_DATE_ACTIVE%TYPE,
4054: p_job_group_id IN PA_RESOURCE_LISTS_ALL_BG.JOB_GROUP_ID%TYPE,
4055: p_control_flag IN PA_RESOURCE_LISTS_ALL_BG.CONTROL_FLAG%TYPE,
4056: p_use_for_wp_flag IN PA_RESOURCE_LISTS_ALL_BG.USE_FOR_WP_FLAG%TYPE,
4057: x_return_status OUT NOCOPY Varchar2,
4058: x_msg_data OUT NOCOPY Varchar2,
4059: x_msg_count OUT NOCOPY NUMBER
4060: )
4058: x_msg_data OUT NOCOPY Varchar2,
4059: x_msg_count OUT NOCOPY NUMBER
4060: )
4061: IS
4062: p_public_flag PA_RESOURCE_LISTS_ALL_BG.public_flag%TYPE;
4063: p_group_resource_type_id PA_RESOURCE_LISTS_ALL_BG.group_resource_type_id%TYPE;
4064: p_uncategorized_flag PA_RESOURCE_LISTS_ALL_BG.uncategorized_flag%TYPE;
4065: p_business_group_id PA_RESOURCE_LISTS_ALL_BG.business_group_id%TYPE;
4066: p_adw_notify_flag PA_RESOURCE_LISTS_ALL_BG.adw_notify_flag%TYPE;
4059: x_msg_count OUT NOCOPY NUMBER
4060: )
4061: IS
4062: p_public_flag PA_RESOURCE_LISTS_ALL_BG.public_flag%TYPE;
4063: p_group_resource_type_id PA_RESOURCE_LISTS_ALL_BG.group_resource_type_id%TYPE;
4064: p_uncategorized_flag PA_RESOURCE_LISTS_ALL_BG.uncategorized_flag%TYPE;
4065: p_business_group_id PA_RESOURCE_LISTS_ALL_BG.business_group_id%TYPE;
4066: p_adw_notify_flag PA_RESOURCE_LISTS_ALL_BG.adw_notify_flag%TYPE;
4067: p_resource_list_type PA_RESOURCE_LISTS_ALL_BG.resource_list_type%TYPE;
4060: )
4061: IS
4062: p_public_flag PA_RESOURCE_LISTS_ALL_BG.public_flag%TYPE;
4063: p_group_resource_type_id PA_RESOURCE_LISTS_ALL_BG.group_resource_type_id%TYPE;
4064: p_uncategorized_flag PA_RESOURCE_LISTS_ALL_BG.uncategorized_flag%TYPE;
4065: p_business_group_id PA_RESOURCE_LISTS_ALL_BG.business_group_id%TYPE;
4066: p_adw_notify_flag PA_RESOURCE_LISTS_ALL_BG.adw_notify_flag%TYPE;
4067: p_resource_list_type PA_RESOURCE_LISTS_ALL_BG.resource_list_type%TYPE;
4068: p_migration_code PA_RESOURCE_LISTS_ALL_BG.migration_code%TYPE;
4061: IS
4062: p_public_flag PA_RESOURCE_LISTS_ALL_BG.public_flag%TYPE;
4063: p_group_resource_type_id PA_RESOURCE_LISTS_ALL_BG.group_resource_type_id%TYPE;
4064: p_uncategorized_flag PA_RESOURCE_LISTS_ALL_BG.uncategorized_flag%TYPE;
4065: p_business_group_id PA_RESOURCE_LISTS_ALL_BG.business_group_id%TYPE;
4066: p_adw_notify_flag PA_RESOURCE_LISTS_ALL_BG.adw_notify_flag%TYPE;
4067: p_resource_list_type PA_RESOURCE_LISTS_ALL_BG.resource_list_type%TYPE;
4068: p_migration_code PA_RESOURCE_LISTS_ALL_BG.migration_code%TYPE;
4069: l_resource_list_member_id PA_RESOURCE_LIST_MEMBERS.RESOURCE_LIST_MEMBER_ID%TYPE;
4062: p_public_flag PA_RESOURCE_LISTS_ALL_BG.public_flag%TYPE;
4063: p_group_resource_type_id PA_RESOURCE_LISTS_ALL_BG.group_resource_type_id%TYPE;
4064: p_uncategorized_flag PA_RESOURCE_LISTS_ALL_BG.uncategorized_flag%TYPE;
4065: p_business_group_id PA_RESOURCE_LISTS_ALL_BG.business_group_id%TYPE;
4066: p_adw_notify_flag PA_RESOURCE_LISTS_ALL_BG.adw_notify_flag%TYPE;
4067: p_resource_list_type PA_RESOURCE_LISTS_ALL_BG.resource_list_type%TYPE;
4068: p_migration_code PA_RESOURCE_LISTS_ALL_BG.migration_code%TYPE;
4069: l_resource_list_member_id PA_RESOURCE_LIST_MEMBERS.RESOURCE_LIST_MEMBER_ID%TYPE;
4070: x_resource_list_id PA_RESOURCE_LISTS_ALL_BG.resource_list_id%TYPE;
4063: p_group_resource_type_id PA_RESOURCE_LISTS_ALL_BG.group_resource_type_id%TYPE;
4064: p_uncategorized_flag PA_RESOURCE_LISTS_ALL_BG.uncategorized_flag%TYPE;
4065: p_business_group_id PA_RESOURCE_LISTS_ALL_BG.business_group_id%TYPE;
4066: p_adw_notify_flag PA_RESOURCE_LISTS_ALL_BG.adw_notify_flag%TYPE;
4067: p_resource_list_type PA_RESOURCE_LISTS_ALL_BG.resource_list_type%TYPE;
4068: p_migration_code PA_RESOURCE_LISTS_ALL_BG.migration_code%TYPE;
4069: l_resource_list_member_id PA_RESOURCE_LIST_MEMBERS.RESOURCE_LIST_MEMBER_ID%TYPE;
4070: x_resource_list_id PA_RESOURCE_LISTS_ALL_BG.resource_list_id%TYPE;
4071: l_resource_list_id NUMBER:=NULL;
4064: p_uncategorized_flag PA_RESOURCE_LISTS_ALL_BG.uncategorized_flag%TYPE;
4065: p_business_group_id PA_RESOURCE_LISTS_ALL_BG.business_group_id%TYPE;
4066: p_adw_notify_flag PA_RESOURCE_LISTS_ALL_BG.adw_notify_flag%TYPE;
4067: p_resource_list_type PA_RESOURCE_LISTS_ALL_BG.resource_list_type%TYPE;
4068: p_migration_code PA_RESOURCE_LISTS_ALL_BG.migration_code%TYPE;
4069: l_resource_list_member_id PA_RESOURCE_LIST_MEMBERS.RESOURCE_LIST_MEMBER_ID%TYPE;
4070: x_resource_list_id PA_RESOURCE_LISTS_ALL_BG.resource_list_id%TYPE;
4071: l_resource_list_id NUMBER:=NULL;
4072: --3596702
4066: p_adw_notify_flag PA_RESOURCE_LISTS_ALL_BG.adw_notify_flag%TYPE;
4067: p_resource_list_type PA_RESOURCE_LISTS_ALL_BG.resource_list_type%TYPE;
4068: p_migration_code PA_RESOURCE_LISTS_ALL_BG.migration_code%TYPE;
4069: l_resource_list_member_id PA_RESOURCE_LIST_MEMBERS.RESOURCE_LIST_MEMBER_ID%TYPE;
4070: x_resource_list_id PA_RESOURCE_LISTS_ALL_BG.resource_list_id%TYPE;
4071: l_resource_list_id NUMBER:=NULL;
4072: --3596702
4073: l_res_list_member_id Number;
4074:
4205: -- hr_utility.trace('l_error_raised =Y');
4206: Raise l_error;
4207: END IF;
4208:
4209: --Get needed data of parent resource list from pa_resource_lists_all_bg
4210: SELECT
4211: public_flag,
4212: group_resource_type_id,
4213: uncategorized_flag,
4224: p_adw_notify_flag,
4225: p_resource_list_type,
4226: p_migration_code
4227: FROM
4228: pa_resource_lists_all_bg
4229: WHERE
4230: resource_list_id=p_parent_resource_list_id;
4231:
4232: -- hr_utility.trace('BG insert');
4230: resource_list_id=p_parent_resource_list_id;
4231:
4232: -- hr_utility.trace('BG insert');
4233:
4234: --Call Insert_row which inserts a row into PA_RESOURCE_LISTS_ALL_BG table
4235: PA_Resource_List_tbl_Pkg.Insert_Row(
4236: p_name,
4237: p_description,
4238: p_public_flag,
4255: -- hr_utility.trace('member insert');
4256:
4257:
4258: --Adding to TL
4259: INSERT into pa_resource_lists_tl (
4260: last_update_login,
4261: creation_date,
4262: created_by,
4263: last_update_date,
4281: FROM FND_LANGUAGES L
4282: WHERE L.INSTALLED_FLAG in ('I', 'B')
4283: and not exists
4284: (select NULL
4285: from pa_resource_lists_tl T
4286: where T.RESOURCE_LIST_ID = X_RESOURCE_LIST_ID
4287: and T.LANGUAGE = L.LANGUAGE_CODE);
4288:
4289:
4641: ***************************************************/
4642: BEGIN
4643: SELECT control_flag
4644: INTO l_control_flag
4645: FROM pa_resource_lists_all_bg
4646: WHERE resource_list_id = l_resource_list_id;
4647: EXCEPTION
4648: WHEN OTHERS THEN
4649: X_Return_Status := Fnd_Api.G_Ret_Sts_UnExp_Error;
4881: P_DESCRIPTION in VARCHAR2
4882: ) is
4883: begin
4884:
4885: update pa_resource_lists_tl set
4886: NAME = P_NAME,
4887: DESCRIPTION = P_DESCRIPTION,
4888: LAST_UPDATE_DATE = sysdate,
4889: LAST_UPDATED_BY = decode(P_OWNER, 'SEED', 1, 0),
4901:
4902: /******************************************************
4903: * Procedure : LOAD_ROW
4904: * Description : This API is used to update or insert rows
4905: * into table pa_resource_lists_bg and
4906: * pa_resource_lits_tl table. This procedure
4907: * is called from the lct file.
4908: * **************************************************/
4909: procedure LOAD_ROW(
4928: CURSOR RES_CUR IS
4929: Select
4930: Rowid
4931: from
4932: PA_RESOURCE_LISTS_ALL_BG
4933: Where Resource_List_Id = P_Resource_List_Id;
4934:
4935: BEGIN
4936:
4942:
4943: --Commented the following two Selects For Bug#5094347. These are not used anywhere in the code.
4944: /*SELECT ROWID
4945: INTO l_row_id
4946: FROM pa_resource_lists_all_bg
4947: WHERE resource_list_id = P_RESOURCE_LIST_ID;
4948:
4949: SELECT nvl(p_resource_list_id,pa_resource_lists_s.NEXTVAL)
4950: INTO l_resource_list_id
4945: INTO l_row_id
4946: FROM pa_resource_lists_all_bg
4947: WHERE resource_list_id = P_RESOURCE_LIST_ID;
4948:
4949: SELECT nvl(p_resource_list_id,pa_resource_lists_s.NEXTVAL)
4950: INTO l_resource_list_id
4951: FROM dual;
4952: */
4953: --End of Commenting for Bug#5094347
4954:
4955: /*Bug 4202015 - Changes Start*/
4956: --If we call PA_Resource_List_tbl_Pkg.Update_Row and then call PA_Resource_List_tbl_Pkg.Insert_Row
4957: --in case no_data_found exception is returned by previous API, then we get
4958: --unique constraint (PA.PA_RESOURCE_LISTS_U2) violation error in case table pa_resource_lists_tl
4959: --is empty. This is due to the fact that although no_data_found has been raised while updating
4960: --record in table pa_resource_lists_tl, we try to insert the same record in table
4961: --PA_RESOURCE_LISTS_ALL_BG in call to PA_Resource_List_tbl_Pkg.Insert_Row.
4962: --Hence we have coded this API to update the records directly in _BG and _TL tables
4956: --If we call PA_Resource_List_tbl_Pkg.Update_Row and then call PA_Resource_List_tbl_Pkg.Insert_Row
4957: --in case no_data_found exception is returned by previous API, then we get
4958: --unique constraint (PA.PA_RESOURCE_LISTS_U2) violation error in case table pa_resource_lists_tl
4959: --is empty. This is due to the fact that although no_data_found has been raised while updating
4960: --record in table pa_resource_lists_tl, we try to insert the same record in table
4961: --PA_RESOURCE_LISTS_ALL_BG in call to PA_Resource_List_tbl_Pkg.Insert_Row.
4962: --Hence we have coded this API to update the records directly in _BG and _TL tables
4963: --and in case of no_data_found exception we insert records in respective tables.
4964:
4957: --in case no_data_found exception is returned by previous API, then we get
4958: --unique constraint (PA.PA_RESOURCE_LISTS_U2) violation error in case table pa_resource_lists_tl
4959: --is empty. This is due to the fact that although no_data_found has been raised while updating
4960: --record in table pa_resource_lists_tl, we try to insert the same record in table
4961: --PA_RESOURCE_LISTS_ALL_BG in call to PA_Resource_List_tbl_Pkg.Insert_Row.
4962: --Hence we have coded this API to update the records directly in _BG and _TL tables
4963: --and in case of no_data_found exception we insert records in respective tables.
4964:
4965: Update PA_RESOURCE_LISTS_ALL_BG
4961: --PA_RESOURCE_LISTS_ALL_BG in call to PA_Resource_List_tbl_Pkg.Insert_Row.
4962: --Hence we have coded this API to update the records directly in _BG and _TL tables
4963: --and in case of no_data_found exception we insert records in respective tables.
4964:
4965: Update PA_RESOURCE_LISTS_ALL_BG
4966: SET
4967: NAME = P_NAME ,
4968: DESCRIPTION = P_DESCRIPTION ,
4969: PUBLIC_FLAG = P_PUBLIC_FLAG ,
4979: LAST_UPDATE_LOGIN = 0
4980: WHERE RESOURCE_LIST_ID = P_RESOURCE_LIST_ID;
4981:
4982: If SQL%NOTFOUND Then
4983: Insert Into PA_RESOURCE_LISTS_ALL_BG
4984: (
4985: RESOURCE_LIST_ID,
4986: NAME ,
4987: DESCRIPTION ,
5025: NULL);
5026: end if;
5027:
5028:
5029: update pa_resource_lists_tl
5030: set
5031: NAME = P_NAME,
5032: DESCRIPTION = P_DESCRIPTION,
5033: LAST_UPDATE_DATE = sysdate,
5037: where resource_list_id = P_RESOURCE_LIST_ID
5038: and userenv('LANG') in (LANGUAGE, SOURCE_LANG);
5039:
5040: if (sql%notfound) then
5041: insert into pa_resource_lists_tl (
5042: LAST_UPDATE_LOGIN,
5043: CREATION_DATE,
5044: CREATED_BY,
5045: LAST_UPDATE_DATE,
5063: from FND_LANGUAGES L
5064: where L.INSTALLED_FLAG in ('I', 'B')
5065: and not exists
5066: (select NULL
5067: from pa_resource_lists_tl T
5068: where T.RESOURCE_LIST_ID = P_RESOURCE_LIST_ID
5069: and T.LANGUAGE = L.LANGUAGE_CODE);
5070: end if;
5071: