[Home] [Help]
41:
42: --Start changes for the code for 13504049
43: if g_use_temp_table = 'Y' and g_generation_scope = 'SINGLE_PROF' and g_static_list_profile = 'N' then
44: hr_utility.set_location(l_proc||' using stage table',20);
45: insert into per_person_list_stage(security_profile_id, person_id, request_id,
46: program_application_id, program_id,
47: program_update_date)
48: select /*+ USE_NL(PSP) */
49: distinct ppl.security_profile_id, pcr.contact_person_id,
48: select /*+ USE_NL(PSP) */
49: distinct ppl.security_profile_id, pcr.contact_person_id,
50: l_req_id, l_appl_id, l_prog_id, l_upd_date
51: from per_contact_relationships pcr,
52: per_person_list_stage ppl,
53: per_security_profiles psp
54: where ppl.person_id = p_person_id
55: and ppl.security_profile_id = psp.security_profile_id
56: and (psp.view_all_contacts_flag = 'N' or
71: where asg.person_id = pcr.contact_person_id
72: and asg.ASSIGNMENT_TYPE <> 'B') -- Bug 4450149
73: and not exists
74: (select /*+ NO_MERGE */ null
75: from per_person_list_stage ppl1
76: where ppl1.person_id = pcr.contact_person_id
77: and ppl1.granted_user_id is null
78: and ppl1.security_profile_id = ppl.security_profile_id);
79:
259:
260: -- Start changes for bug 13504049
261: if g_use_temp_table = 'Y' and g_generation_scope = 'SINGLE_PROF' and g_static_list_profile = 'N' then
262: hr_utility.set_location(l_proc||' using stage table',50);
263: insert into per_person_list_stage(security_profile_id, person_id,
264: request_id, program_application_id,
265: program_id, program_update_date)
266: values (l_sp_tbl(i), l_per_tbl(j), l_req_id,
267: l_appl_id, l_prog_id, l_upd_date);
843: -- Query #1
844: -- Start changes for bug 13504049
845: if g_use_temp_table = 'Y' and g_generation_scope = 'SINGLE_PROF' and g_static_list_profile = 'N' then
846: hr_utility.set_location(l_proc||' using stage table', 14);
847: insert into per_person_list_stage(security_profile_id, request_id, program_id
848: ,program_application_id, program_update_date
849: ,person_id)
850: select distinct p_security_profile_id, l_req_id, l_prog_id,
851: l_appl_id, l_upd_date, pcr.contact_person_id
861: where asg.person_id = pcr.contact_person_id
862: and asg.ASSIGNMENT_TYPE <> 'B') -- Bug 4450149
863: and not exists
864: (select null
865: from per_person_list_stage ppl1
866: where ppl1.person_id = pcr.contact_person_id
867: and ppl1.granted_user_id is null
868: and ppl1.security_profile_id = p_security_profile_id ); -- ppl.security_profile_id) for bug (6376000/4774264)
869: else
911: -- Query #2
912:
913: if g_use_temp_table = 'Y' and g_generation_scope = 'SINGLE_PROF' and g_static_list_profile = 'N' then
914: hr_utility.set_location(l_proc||' using stage table', 24);
915: insert into per_person_list_stage(security_profile_id, request_id, program_id
916: ,program_application_id, program_update_date
917: ,person_id)
918: select distinct ppl.security_profile_id, l_req_id, l_prog_id,
919: l_appl_id, l_upd_date, pcr.contact_person_id
917: ,person_id)
918: select distinct ppl.security_profile_id, l_req_id, l_prog_id,
919: l_appl_id, l_upd_date, pcr.contact_person_id
920: from per_contact_relationships pcr,
921: per_person_list_stage ppl
922: where ppl.person_id = pcr.person_id
923: and (pcr.business_group_id = p_business_group_id or
924: p_business_group_id is null)
925: and ppl.security_profile_id = p_security_profile_id
929: where asg.person_id = pcr.contact_person_id
930: and asg.ASSIGNMENT_TYPE <> 'B') -- Bug 4450149
931: and not exists
932: (select null
933: from per_person_list_stage ppl1
934: where ppl1.person_id = pcr.contact_person_id
935: and ppl1.granted_user_id is null
936: and ppl1.security_profile_id = ppl.security_profile_id);
937: else
970: -- Query #3
971:
972: if g_use_temp_table = 'Y' and g_generation_scope = 'SINGLE_PROF' and g_static_list_profile = 'N' then
973: hr_utility.set_location(l_proc||' using stage table', 34);
974: insert into per_person_list_stage(security_profile_id, request_id,
975: program_application_id, program_id,
976: program_update_date, person_id)
977: select distinct psp.security_profile_id, l_req_id, l_appl_id,
978: l_prog_id, l_upd_date, papf.person_id
997: and ptuf.person_type_id = ppt.person_type_id
998: and ptuf.person_id = papf.person_id)
999: and not exists
1000: (select null
1001: from per_person_list_stage ppl
1002: where ppl.person_id = papf.person_id
1003: and ppl.granted_user_id is null
1004: and ppl.security_profile_id = psp.security_profile_id);
1005: else
1070: --
1071: -- Start change for bug 13504049
1072: if g_use_temp_table = 'Y' and g_generation_scope = 'SINGLE_PROF' and g_static_list_profile = 'N' then
1073: hr_utility.set_location(l_proc||' using stage table', 14);
1074: INSERT INTO per_person_list_stage
1075: (security_profile_id,
1076: person_id,
1077: request_id,
1078: program_application_id,
1100: WHERE pos.person_id = plc.person_id
1101: AND l_effective_date > pos.effective_start_date)
1102: AND NOT EXISTS
1103: (SELECT NULL
1104: FROM per_person_list_stage ppl
1105: WHERE ppl.person_id = plc.person_id
1106: AND ppl.granted_user_Id IS NULL
1107: AND ppl.security_profile_id = plc.security_profile_id);
1108: else
1309:
1310: if g_use_temp_table = 'Y' and g_generation_scope = 'SINGLE_PROF' and g_static_list_profile = 'N' then
1311: hr_utility.set_location('init_statement using stage table',14);
1312: fnd_dsql.add_text(
1313: 'INSERT into per_person_list_stage
1314: (security_profile_id,
1315: person_id,
1316: request_id,
1317: program_application_id,
1531:
1532: -- Start changes for bug 13504049
1533: if g_use_temp_table = 'Y' and g_generation_scope = 'SINGLE_PROF' and g_static_list_profile = 'N' then
1534: fnd_dsql.add_text(' and not exists(select 1
1535: from per_person_list_stage ppl
1536: where ppl.security_profile_id = ');
1537: else
1538:
1539: fnd_dsql.add_text(' and not exists(select 1
1593: -- Clear the records for this person.
1594:
1595: -- Bug6809753 - start
1596: if g_use_temp_table = 'Y' and g_generation_scope = 'SINGLE_PROF' and g_static_list_profile = 'N' then
1597: l_del_str := ' delete from per_person_list_stage ppl where
1598: ppl.person_id = :p_person_id
1599: and ppl.granted_user_id is null and exists
1600: (select ''X'' from per_security_profiles pspf
1601: where pspf.security_profile_id = ppl.security_profile_id ';
1876: if p_generation_scope <> 'ALL_BUS_GRP' then
1877:
1878: if g_use_temp_table = 'Y' and g_generation_scope = 'SINGLE_PROF' and g_static_list_profile = 'N' then
1879: hr_utility.set_location(l_proc||' using stage table',14);
1880: delete from per_person_list_stage ppl
1881: where ppl.security_profile_id in
1882: (select pspf.security_profile_id
1883: from per_security_profiles pspf
1884: where (pspf.view_all_contacts_flag = 'N' or
1988: -- Start changes for bug 13504049
1989: if g_use_temp_table = 'Y' and g_generation_scope = 'SINGLE_PROF' and g_static_list_profile = 'N' then
1990: hr_utility.set_location(l_proc||' using stage table',34);
1991: delete
1992: from per_person_list_stage
1993: where security_profile_id = p_security_profile_id
1994: and granted_user_id is null;
1995: else
1996: hr_utility.set_location(l_proc||' using actual table',38);
4303: if g_use_temp_table = 'Y' and g_generation_scope = 'SINGLE_PROF' and g_static_list_profile = 'N' then
4304: hr_utility.set_location(l_proc||' using stage table',24);
4305: forall per_rec in l_c_security_profile_table.first .. l_c_security_profile_table.last
4306: SAVE EXCEPTIONS
4307: Insert into per_person_list_stage(security_profile_id,
4308: person_id,request_id,
4309: program_application_id,
4310: program_id,
4311: program_update_date)
4403: if g_use_temp_table = 'Y' and g_generation_scope = 'SINGLE_PROF' and g_static_list_profile = 'N' then
4404: hr_utility.set_location(l_proc||'deleting stage table', 24);
4405: forall per_rec in l_d_security_profile_table.first .. l_d_security_profile_table.last
4406: SAVE EXCEPTIONS
4407: Delete from per_person_list_stage
4408: where person_id = p_person_id
4409: and security_profile_id = l_d_security_profile_table(per_rec);
4410: else
4411: hr_utility.set_location(l_proc||'deleting actual table', 28);
5511: PROGRAM_APPLICATION_ID,
5512: PROGRAM_ID,
5513: PROGRAM_UPDATE_DATE,
5514: GRANTED_USER_ID
5515: from per_person_list_stage a
5516: where not exists (
5517: select 1
5518: from per_person_list
5519: where security_profile_id=a.security_profile_id
5524: delete from per_person_list a
5525: where security_profile_id=p_security_profile_id
5526: and not exists (
5527: select 1
5528: from per_person_list_stage
5529: where person_id=a.person_Id
5530: and nvl(granted_user_id,-1) = nvl(a.granted_user_id,-1));
5531:
5532: commit;
5900: else
5901:
5902: if g_generation_scope = 'SINGLE_PROF' and g_use_temp_table = 'Y' then
5903: g_static_list_profile := 'N';
5904: insert into per_person_list_stage(
5905: SECURITY_PROFILE_ID,
5906: PERSON_ID,
5907: REQUEST_ID,
5908: PROGRAM_APPLICATION_ID,