260: BEGIN
261: l_fii_schema := 'FII';
262:
263: g_phase := 'Populating IND_MAX_BATCH_PARTY_ID in fii_change_log';
264: FII_UTIL.Write_Log(g_phase);
265:
266: select nvl(max(batch_party_id), -1)
267: into l_max_batch_party_id
268: from hz_merge_party_history m,
345: ORDER BY owner_table_id
346: )
347: GROUP BY party_id, class_category;
348:
349: FII_UTIL.Write_Log('Inserted ' || SQL%ROWCOUNT || ' rows into fii_party_mkt_class');
350:
351: commit; --Added for ORA-12838: cannot read/modify an object after modifying it in parallel
352:
353: bis_collection_utilities.log('Populating FII_PARTY_MKT_CLASS table for unassigned customers');
385: WHERE class_category = g_class_type
386: )
387: );
388:
389: FII_UTIL.Write_Log('Inserted ' || SQL%ROWCOUNT || ' rows into fii_party_mkt_class');
390:
391: EXCEPTION
392: WHEN OTHERS THEN
393: l_error_message := sqlerrm;
409: BEGIN
410: l_fii_schema := 'FII';
411:
412: g_phase := 'Getting maximum batch_party_id from fii_change_log table';
413: FII_UTIL.Write_Log (g_phase);
414:
415: select item_value
416: into l_max_batch_party_id
417: from fii_change_log
416: into l_max_batch_party_id
417: from fii_change_log
418: where log_item = 'IND_MAX_BATCH_PARTY_ID';
419:
420: FII_UTIL.Write_Log ('IND_MAX_BATCH_PARTY_ID = '||l_max_batch_party_id);
421:
422: g_phase := 'Deleting merged parties';
423: FII_UTIL.Write_Log (g_phase);
424:
419:
420: FII_UTIL.Write_Log ('IND_MAX_BATCH_PARTY_ID = '||l_max_batch_party_id);
421:
422: g_phase := 'Deleting merged parties';
423: FII_UTIL.Write_Log (g_phase);
424:
425: Delete from fii_party_mkt_class
426: where party_id in
427: (select from_entity_id
431: and d.entity_name = 'HZ_PARTIES'
432: and batch_party_id > l_max_batch_party_id);
433:
434: g_phase := 'Logging maximum batch_party_id into fii_change_log table';
435: FII_UTIL.Write_Log (g_phase);
436:
437: select nvl(max(batch_party_id), -1)
438: into l_max_batch_party_id
439: from hz_merge_party_history m,