2267: if(regid_proc = true) then
2268: insert into hz_application_trans_gt(app_id,party_id) select 690, temp.party_id from hz_purge_gt temp where
2269:
2270:
2271: exists (select 'Y' from JTF_TASKS_B xx where xx.CUSTOMER_ID = temp.party_id
2272: )
2273:
2274: or exists (select 'Y' from JTF_TASKS_B xx where xx.SOURCE_OBJECT_ID = temp.party_id
2275: and (SOURCE_OBJECT_TYPE_CODE in (select object_code from jtf_objects_b where ltrim(rtrim(upper(from_table))) = 'HZ_PARTIES' and rtrim(ltrim(upper(select_id))) = 'PARTY_ID')))
2270:
2271: exists (select 'Y' from JTF_TASKS_B xx where xx.CUSTOMER_ID = temp.party_id
2272: )
2273:
2274: or exists (select 'Y' from JTF_TASKS_B xx where xx.SOURCE_OBJECT_ID = temp.party_id
2275: and (SOURCE_OBJECT_TYPE_CODE in (select object_code from jtf_objects_b where ltrim(rtrim(upper(from_table))) = 'HZ_PARTIES' and rtrim(ltrim(upper(select_id))) = 'PARTY_ID')))
2276:
2277: or exists (select 'Y' from JTF_TASK_AUDITS_B xx where xx.NEW_CUSTOMER_ID = temp.party_id
2278: )
2303: or exists (select 'Y' from HZ_PARTY_SITES
2304: xx where xx.PARTY_ID = temp.party_id
2305: and (nvl(STATUS, 'A') in ('A','I'))
2306: and exists
2307: (select 'Y' from JTF_TASKS_B
2308: yy where yy.ADDRESS_ID=xx.PARTY_SITE_ID
2309: ))
2310:
2311: or exists (select 'Y' from HZ_PARTY_SITES
2453: else
2454: delete from hz_purge_gt temp where
2455:
2456:
2457: exists (select 'Y' from JTF_TASKS_B xx where xx.CUSTOMER_ID = temp.party_id
2458: )
2459:
2460: or exists (select 'Y' from JTF_TASKS_B xx where xx.SOURCE_OBJECT_ID = temp.party_id
2461: and (SOURCE_OBJECT_TYPE_CODE in (select object_code from jtf_objects_b where ltrim(rtrim(upper(from_table))) = 'HZ_PARTIES' and rtrim(ltrim(upper(select_id))) = 'PARTY_ID')))
2456:
2457: exists (select 'Y' from JTF_TASKS_B xx where xx.CUSTOMER_ID = temp.party_id
2458: )
2459:
2460: or exists (select 'Y' from JTF_TASKS_B xx where xx.SOURCE_OBJECT_ID = temp.party_id
2461: and (SOURCE_OBJECT_TYPE_CODE in (select object_code from jtf_objects_b where ltrim(rtrim(upper(from_table))) = 'HZ_PARTIES' and rtrim(ltrim(upper(select_id))) = 'PARTY_ID')))
2462:
2463: or exists (select 'Y' from JTF_TASK_AUDITS_B xx where xx.NEW_CUSTOMER_ID = temp.party_id
2464: )
2489: or exists (select 'Y' from HZ_PARTY_SITES
2490: xx where xx.PARTY_ID = temp.party_id
2491: and (nvl(STATUS, 'A') in ('A','I'))
2492: and exists
2493: (select 'Y' from JTF_TASKS_B
2494: yy where yy.ADDRESS_ID=xx.PARTY_SITE_ID
2495: ))
2496:
2497: or exists (select 'Y' from HZ_PARTY_SITES