2528: or exists (select 'Y' from HZ_PARTY_SITES
2529: xx where xx.PARTY_ID = temp.party_id
2530: and (nvl(STATUS, 'A') in ('A','I'))
2531: and exists
2532: (select 'Y' from JTF_TTY_NAMED_ACCTS
2533: yy where yy.PARTY_SITE_ID=xx.PARTY_SITE_ID
2534: ))
2535:
2536: or exists (select 'Y' from JTF_TTY_NAMED_ACCTS xx where xx.PARTY_ID = temp.party_id
2532: (select 'Y' from JTF_TTY_NAMED_ACCTS
2533: yy where yy.PARTY_SITE_ID=xx.PARTY_SITE_ID
2534: ))
2535:
2536: or exists (select 'Y' from JTF_TTY_NAMED_ACCTS xx where xx.PARTY_ID = temp.party_id
2537: );
2538: else
2539: delete from hz_purge_gt temp where
2540:
2722: or exists (select 'Y' from HZ_PARTY_SITES
2723: xx where xx.PARTY_ID = temp.party_id
2724: and (nvl(STATUS, 'A') in ('A','I'))
2725: and exists
2726: (select 'Y' from JTF_TTY_NAMED_ACCTS
2727: yy where yy.PARTY_SITE_ID=xx.PARTY_SITE_ID
2728: ))
2729:
2730: or exists (select 'Y' from JTF_TTY_NAMED_ACCTS xx where xx.PARTY_ID = temp.party_id
2726: (select 'Y' from JTF_TTY_NAMED_ACCTS
2727: yy where yy.PARTY_SITE_ID=xx.PARTY_SITE_ID
2728: ))
2729:
2730: or exists (select 'Y' from JTF_TTY_NAMED_ACCTS xx where xx.PARTY_ID = temp.party_id
2731: );
2732: end if;
2733:
2734: