207: PROCEDURE Insert_New_Cust IS
208:
209: CURSOR party_cur IS
210: SELECT party_id, MIN(NVL(account_established_date,creation_date))
211: FROM hz_cust_accounts
212: GROUP BY party_id
213: HAVING MIN(NVL(account_established_date,creation_date)) >=
214: ADD_MONTHS(g_lc_st_month,g_lc_new_cust_period*-1 +1 );
215: x_party_id hz_cust_accounts.party_id % TYPE;
211: FROM hz_cust_accounts
212: GROUP BY party_id
213: HAVING MIN(NVL(account_established_date,creation_date)) >=
214: ADD_MONTHS(g_lc_st_month,g_lc_new_cust_period*-1 +1 );
215: x_party_id hz_cust_accounts.party_id % TYPE;
216: x_account_established_date hz_cust_accounts.account_established_date % TYPE;
217: BEGIN
218: bic_summary_extract_pkg.debug(' entered Insert_New_Cust + : ');
219: OPEN party_cur;
212: GROUP BY party_id
213: HAVING MIN(NVL(account_established_date,creation_date)) >=
214: ADD_MONTHS(g_lc_st_month,g_lc_new_cust_period*-1 +1 );
215: x_party_id hz_cust_accounts.party_id % TYPE;
216: x_account_established_date hz_cust_accounts.account_established_date % TYPE;
217: BEGIN
218: bic_summary_extract_pkg.debug(' entered Insert_New_Cust + : ');
219: OPEN party_cur;
220: LOOP