[Home] [Help]
1384: or exists (select 'Y' from HZ_PARTY_SITES
1385: xx where xx.PARTY_ID = temp.party_id
1386: and (nvl(STATUS, 'A') in ('A','I'))
1387: and exists
1388: (select 'Y' from AS_CURRENT_ENVIRONMENT
1389: yy where yy.ADDRESS_ID=xx.PARTY_SITE_ID
1390: ))
1391:
1392: or exists (select 'Y' from HZ_PARTY_SITES
1703: or exists (select 'Y' from HZ_PARTY_SITES
1704: xx where xx.PARTY_ID = temp.party_id
1705: and (nvl(STATUS, 'A') in ('A','I'))
1706: and exists
1707: (select 'Y' from AS_CURRENT_ENVIRONMENT
1708: yy where yy.ADDRESS_ID=xx.PARTY_SITE_ID
1709: ))
1710:
1711: or exists (select 'Y' from HZ_PARTY_SITES
4044: delete /*+ parallel(temp) */ from hz_purge_gt temp where
4045: temp.party_id in (select /*+ parallel(xx)*/ xx.CLOSE_COMPETITOR_ID from AS_LEADS_LOG xx
4046: );
4047: end if;
4048: --AS_CURRENT_ENVIRONMENT;CUSTOMER_ID
4049: appid:=279;
4050: if(regid_proc = true) then
4051: insert into hz_application_trans_gt(app_id,party_id) select 279, temp.party_id from hz_purge_gt temp where not exists(select 'Y' from hz_application_trans_gt appl where appl.app_id = 279 and appl.party_id=temp.party_id) and
4052:
4049: appid:=279;
4050: if(regid_proc = true) then
4051: insert into hz_application_trans_gt(app_id,party_id) select 279, temp.party_id from hz_purge_gt temp where not exists(select 'Y' from hz_application_trans_gt appl where appl.app_id = 279 and appl.party_id=temp.party_id) and
4052:
4053: temp.party_id in (select /*+ parallel(xx)*/ xx.CUSTOMER_ID from AS_CURRENT_ENVIRONMENT xx
4054: );
4055: else
4056: delete /*+ parallel(temp) */ from hz_purge_gt temp where
4057: temp.party_id in (select /*+ parallel(xx)*/ xx.CUSTOMER_ID from AS_CURRENT_ENVIRONMENT xx
4053: temp.party_id in (select /*+ parallel(xx)*/ xx.CUSTOMER_ID from AS_CURRENT_ENVIRONMENT xx
4054: );
4055: else
4056: delete /*+ parallel(temp) */ from hz_purge_gt temp where
4057: temp.party_id in (select /*+ parallel(xx)*/ xx.CUSTOMER_ID from AS_CURRENT_ENVIRONMENT xx
4058: );
4059: end if;
4060: --AS_SALES_LEADS;REFERRED_BY
4061: appid:=279;