148: fnd_file.put_line(fnd_file.log, 'p_parent_entity_name : '||p_parent_entity_name);
149: fnd_file.put_line(fnd_file.log, 'p_batch_id : '||p_batch_id);
150: fnd_file.put_line(fnd_file.log, 'p_batch_party_id : '||p_batch_party_id);
151: --
152: arp_message.set_line('OKC_PARTY_MERGE_PKG.OKC_CPL_MERGE_PARTY()+');
153:
154: x_return_status := FND_API.G_RET_STS_SUCCESS;
155:
156: --
194: if p_from_fk_id <> p_to_fk_id then
195: --
196: begin
197:
198: arp_message.set_name('AR','AR_UPDATING_TABLE');
199: arp_message.set_token('TABLE_NAME','OKC_K_PARTY_ROLES',FALSE);
200: fnd_file.put_line(fnd_file.log, 'Updating Table okc_k_party_roles_b');
201: --
202: --
195: --
196: begin
197:
198: arp_message.set_name('AR','AR_UPDATING_TABLE');
199: arp_message.set_token('TABLE_NAME','OKC_K_PARTY_ROLES',FALSE);
200: fnd_file.put_line(fnd_file.log, 'Updating Table okc_k_party_roles_b');
201: --
202: --
203: -- Fix for bug 4105272 Insert into okc_k_vers_numbers_h
250: --npalepu added on 10-feb-2006 for bug # 5005475
251: l_count := sql%rowcount;
252:
253: fnd_file.put_line(fnd_file.log, 'No of Rows Updated : '||l_count);
254: arp_message.set_name('AR','AR_ROWS_UPDATED');
255: arp_message.set_token('NUM_ROWS',to_char(l_count));
256:
257: OPEN l_get_cpl_ids_csr;
258: LOOP
251: l_count := sql%rowcount;
252:
253: fnd_file.put_line(fnd_file.log, 'No of Rows Updated : '||l_count);
254: arp_message.set_name('AR','AR_ROWS_UPDATED');
255: arp_message.set_token('NUM_ROWS',to_char(l_count));
256:
257: OPEN l_get_cpl_ids_csr;
258: LOOP
259: FETCH l_get_cpl_ids_csr BULK COLLECT INTO l_from_cpl_id, l_to_cpl_id LIMIT 1000;
274: WHERE cntc.cpl_id = l_from_cpl_id(i);
275:
276: l_count := sql%rowcount;
277: fnd_file.put_line(fnd_file.log, 'No of Rows Updated : '||l_count);
278: arp_message.set_name('AR','AR_ROWS_UPDATED');
279: arp_message.set_token('NUM_ROWS',to_char(l_count));
280:
281: fnd_file.put_line(fnd_file.log, 'Deleting Table OKC_K_PARTY_ROLES_TL');
282: -- Delete party_roles_tl table to handle related party merge Bug # 4529376
275:
276: l_count := sql%rowcount;
277: fnd_file.put_line(fnd_file.log, 'No of Rows Updated : '||l_count);
278: arp_message.set_name('AR','AR_ROWS_UPDATED');
279: arp_message.set_token('NUM_ROWS',to_char(l_count));
280:
281: fnd_file.put_line(fnd_file.log, 'Deleting Table OKC_K_PARTY_ROLES_TL');
282: -- Delete party_roles_tl table to handle related party merge Bug # 4529376
283:
356: --
357: l_count := sql%rowcount;
358:
359: fnd_file.put_line(fnd_file.log, 'No of Rows Updated : '||l_count);
360: arp_message.set_name('AR','AR_ROWS_UPDATED');
361: arp_message.set_token('NUM_ROWS',to_char(l_count));
362: --
363: OKS_CODE_HOOK.Update_Party_Merge(p_entity_name =>p_entity_name
364: ,p_from_id =>p_from_id
357: l_count := sql%rowcount;
358:
359: fnd_file.put_line(fnd_file.log, 'No of Rows Updated : '||l_count);
360: arp_message.set_name('AR','AR_ROWS_UPDATED');
361: arp_message.set_token('NUM_ROWS',to_char(l_count));
362: --
363: OKS_CODE_HOOK.Update_Party_Merge(p_entity_name =>p_entity_name
364: ,p_from_id =>p_from_id
365: ,p_from_fk_id =>p_from_fk_id
368: ,p_batch_id =>p_batch_id
369: ,p_batch_party_id =>p_batch_party_id
370: ,x_hook =>l_hook);
371: If l_hook =1 then
372: arp_message.set_line('OKS_CODE_HOOK.Update_Party_Merge()-');
373: Elsif l_hook = -1 then
374: arp_message.set_line('Exception in OKS_CODE_HOOK.Update_Party_Merge()-');
375: End If;
376:
370: ,x_hook =>l_hook);
371: If l_hook =1 then
372: arp_message.set_line('OKS_CODE_HOOK.Update_Party_Merge()-');
373: Elsif l_hook = -1 then
374: arp_message.set_line('Exception in OKS_CODE_HOOK.Update_Party_Merge()-');
375: End If;
376:
377: exception
378: when OKC_API.G_EXCEPTION_ERROR THEN -- Bug 2949149
375: End If;
376:
377: exception
378: when OKC_API.G_EXCEPTION_ERROR THEN -- Bug 2949149
379: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || sqlerrm);
380: fnd_file.put_line(fnd_file.log, g_proc_name||'.'||l_api_name||':'||sqlerrm);
381: x_return_status := FND_API.G_RET_STS_ERROR;
382: when OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN -- Bug 2949149
383: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || sqlerrm);
379: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || sqlerrm);
380: fnd_file.put_line(fnd_file.log, g_proc_name||'.'||l_api_name||':'||sqlerrm);
381: x_return_status := FND_API.G_RET_STS_ERROR;
382: when OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN -- Bug 2949149
383: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || sqlerrm);
384: fnd_file.put_line(fnd_file.log, g_proc_name||'.'||l_api_name||':'||sqlerrm);
385: x_return_status := FND_API.G_RET_STS_ERROR;
386: when others then
387: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || sqlerrm);
383: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || sqlerrm);
384: fnd_file.put_line(fnd_file.log, g_proc_name||'.'||l_api_name||':'||sqlerrm);
385: x_return_status := FND_API.G_RET_STS_ERROR;
386: when others then
387: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || sqlerrm);
388: --
389: fnd_file.put_line(fnd_file.log,(g_proc_name || '.' || l_api_name ||
390: 'OKC_K_PARTY_ROLES = ' ||l_object_user_code||'-'|| p_from_id));
391: --
427: fnd_file.put_line(fnd_file.log, 'p_parent_entity_name : '||p_parent_entity_name);
428: fnd_file.put_line(fnd_file.log, 'p_batch_id : '||p_batch_id);
429: fnd_file.put_line(fnd_file.log, 'p_batch_party_id : '||p_batch_party_id);
430: --
431: arp_message.set_line('OKC_PARTY_MERGE_PKG.OKC_RUL_MERGE_PARTY_ID1()+');
432:
433: x_return_status := FND_API.G_RET_STS_SUCCESS;
434:
435: --
473:
474: if p_from_fk_id <> p_to_fk_id then
475: begin
476: -- Rules ID1
477: arp_message.set_name('AR','AR_UPDATING_TABLE');
478: arp_message.set_token('TABLE_NAME','OKC_RULES_B.OBJECT1_ID1',FALSE);
479: fnd_file.put_line(fnd_file.log, 'Updating Table okc_rules_b');
480: --
481: UPDATE okc_rules_b rle
474: if p_from_fk_id <> p_to_fk_id then
475: begin
476: -- Rules ID1
477: arp_message.set_name('AR','AR_UPDATING_TABLE');
478: arp_message.set_token('TABLE_NAME','OKC_RULES_B.OBJECT1_ID1',FALSE);
479: fnd_file.put_line(fnd_file.log, 'Updating Table okc_rules_b');
480: --
481: UPDATE okc_rules_b rle
482: SET rle.object1_id1 = p_to_fk_id
495: --
496: l_count := sql%rowcount;
497:
498: fnd_file.put_line(fnd_file.log, 'No of Rows Updated : '||l_count);
499: arp_message.set_name('AR','AR_ROWS_UPDATED');
500: arp_message.set_token('NUM_ROWS',to_char(l_count));
501: --
502: --
503: exception
496: l_count := sql%rowcount;
497:
498: fnd_file.put_line(fnd_file.log, 'No of Rows Updated : '||l_count);
499: arp_message.set_name('AR','AR_ROWS_UPDATED');
500: arp_message.set_token('NUM_ROWS',to_char(l_count));
501: --
502: --
503: exception
504: when others then
501: --
502: --
503: exception
504: when others then
505: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || sqlerrm);
506: --
507: fnd_file.put_line(fnd_file.log,(g_proc_name || '.' || l_api_name ||
508: 'OKC_K_PARTY_ROLES for = ' ||l_object_user_code||'-'|| p_from_id));
509: --
546: fnd_file.put_line(fnd_file.log, 'p_parent_entity_name : '||p_parent_entity_name);
547: fnd_file.put_line(fnd_file.log, 'p_batch_id : '||p_batch_id);
548: fnd_file.put_line(fnd_file.log, 'p_batch_party_id : '||p_batch_party_id);
549: --
550: arp_message.set_line('OKC_PARTY_MERGE_PKG.OKC_RUL_MERGE_PARTY_ID2()+');
551:
552: x_return_status := FND_API.G_RET_STS_SUCCESS;
553:
554: --
592:
593: if p_from_fk_id <> p_to_fk_id then
594: begin
595: -- Rules ID1
596: arp_message.set_name('AR','AR_UPDATING_TABLE');
597: arp_message.set_token('TABLE_NAME','OKC_RULES_B.OBJECT1_ID1',FALSE);
598: fnd_file.put_line(fnd_file.log, 'Updating Table okc_rules_b');
599: --
600: UPDATE okc_rules_b rle
593: if p_from_fk_id <> p_to_fk_id then
594: begin
595: -- Rules ID1
596: arp_message.set_name('AR','AR_UPDATING_TABLE');
597: arp_message.set_token('TABLE_NAME','OKC_RULES_B.OBJECT1_ID1',FALSE);
598: fnd_file.put_line(fnd_file.log, 'Updating Table okc_rules_b');
599: --
600: UPDATE okc_rules_b rle
601: SET rle.object2_id1 = p_to_fk_id
614: --
615: l_count := sql%rowcount;
616:
617: fnd_file.put_line(fnd_file.log, 'No of Rows Updated : '||l_count);
618: arp_message.set_name('AR','AR_ROWS_UPDATED');
619: arp_message.set_token('NUM_ROWS',to_char(l_count));
620: --
621: --
622: exception
615: l_count := sql%rowcount;
616:
617: fnd_file.put_line(fnd_file.log, 'No of Rows Updated : '||l_count);
618: arp_message.set_name('AR','AR_ROWS_UPDATED');
619: arp_message.set_token('NUM_ROWS',to_char(l_count));
620: --
621: --
622: exception
623: when others then
620: --
621: --
622: exception
623: when others then
624: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || sqlerrm);
625: --
626: fnd_file.put_line(fnd_file.log,(g_proc_name || '.' || l_api_name ||
627: 'OKC_K_PARTY_ROLES for = ' ||l_object_user_code||'-'|| p_from_id));
628: --
664: fnd_file.put_line(fnd_file.log, 'p_parent_entity_name : '||p_parent_entity_name);
665: fnd_file.put_line(fnd_file.log, 'p_batch_id : '||p_batch_id);
666: fnd_file.put_line(fnd_file.log, 'p_batch_party_id : '||p_batch_party_id);
667: --
668: arp_message.set_line('OKC_PARTY_MERGE_PKG.OKC_RUL_MERGE_PARTY_ID3()+');
669:
670: x_return_status := FND_API.G_RET_STS_SUCCESS;
671: --
672: --
709:
710: if p_from_fk_id <> p_to_fk_id then
711: begin
712: -- Rules ID3
713: arp_message.set_name('AR','AR_UPDATING_TABLE');
714: arp_message.set_token('TABLE_NAME','OKC_RULES_B.OBJECT3_ID1',FALSE);
715: fnd_file.put_line(fnd_file.log, 'Updating Table okc_rules_b');
716: --
717: UPDATE okc_rules_b rle
710: if p_from_fk_id <> p_to_fk_id then
711: begin
712: -- Rules ID3
713: arp_message.set_name('AR','AR_UPDATING_TABLE');
714: arp_message.set_token('TABLE_NAME','OKC_RULES_B.OBJECT3_ID1',FALSE);
715: fnd_file.put_line(fnd_file.log, 'Updating Table okc_rules_b');
716: --
717: UPDATE okc_rules_b rle
718: SET rle.object3_id1 = p_to_fk_id
732: --
733: l_count := sql%rowcount;
734:
735: fnd_file.put_line(fnd_file.log, 'No of Rows Updated : '||l_count);
736: arp_message.set_name('AR','AR_ROWS_UPDATED');
737: arp_message.set_token('NUM_ROWS',to_char(l_count));
738: --
739: --
740: exception
733: l_count := sql%rowcount;
734:
735: fnd_file.put_line(fnd_file.log, 'No of Rows Updated : '||l_count);
736: arp_message.set_name('AR','AR_ROWS_UPDATED');
737: arp_message.set_token('NUM_ROWS',to_char(l_count));
738: --
739: --
740: exception
741: when others then
738: --
739: --
740: exception
741: when others then
742: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || sqlerrm);
743: --
744: fnd_file.put_line(fnd_file.log,(g_proc_name || '.' || l_api_name ||
745: 'OKC_K_PARTY_ROLES for = ' ||l_object_user_code||'-'|| p_from_id));
746: --
781: fnd_file.put_line(fnd_file.log, 'p_parent_entity_name : '||p_parent_entity_name);
782: fnd_file.put_line(fnd_file.log, 'p_batch_id : '||p_batch_id);
783: fnd_file.put_line(fnd_file.log, 'p_batch_party_id : '||p_batch_party_id);
784: --
785: arp_message.set_line('OKC_PARTY_MERGE_PKG.OKC_CIM_MERGE_PARTY()+');
786:
787: x_return_status := FND_API.G_RET_STS_SUCCESS;
788:
789: --
826: -- not transfer and return the id of the duplicate record as the Merged To Id
827:
828: if p_from_fk_id <> p_to_fk_id then
829: begin
830: arp_message.set_name('AR','AR_UPDATING_TABLE');
831: arp_message.set_token('TABLE_NAME','OKC_K_ITEMS',FALSE);
832: fnd_file.put_line(fnd_file.log, 'Updating Table okc_k_items');
833: --
834: --
827:
828: if p_from_fk_id <> p_to_fk_id then
829: begin
830: arp_message.set_name('AR','AR_UPDATING_TABLE');
831: arp_message.set_token('TABLE_NAME','OKC_K_ITEMS',FALSE);
832: fnd_file.put_line(fnd_file.log, 'Updating Table okc_k_items');
833: --
834: --
835: UPDATE okc_k_items cim
849: --
850: l_count := sql%rowcount;
851:
852: fnd_file.put_line(fnd_file.log, 'No of Rows Updated : '||l_count);
853: arp_message.set_name('AR','AR_ROWS_UPDATED');
854: arp_message.set_token('NUM_ROWS',to_char(l_count));
855: --
856: exception
857: when others then
850: l_count := sql%rowcount;
851:
852: fnd_file.put_line(fnd_file.log, 'No of Rows Updated : '||l_count);
853: arp_message.set_name('AR','AR_ROWS_UPDATED');
854: arp_message.set_token('NUM_ROWS',to_char(l_count));
855: --
856: exception
857: when others then
858: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || sqlerrm);
854: arp_message.set_token('NUM_ROWS',to_char(l_count));
855: --
856: exception
857: when others then
858: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || sqlerrm);
859: --
860: fnd_file.put_line(fnd_file.log,(g_proc_name || '.' || l_api_name ||
861: 'OKC_K_PARTY_ROLES for = ' ||l_object_user_code||'-'|| p_from_id));
862: --
897: fnd_file.put_line(fnd_file.log, 'p_parent_entity_name : '||p_parent_entity_name);
898: fnd_file.put_line(fnd_file.log, 'p_batch_id : '||p_batch_id);
899: fnd_file.put_line(fnd_file.log, 'p_batch_party_id : '||p_batch_party_id);
900: --
901: arp_message.set_line('OKC_PARTY_MERGE_PKG.OKC_CTC_MERGE_PARTY()+');
902:
903: x_return_status := FND_API.G_RET_STS_SUCCESS;
904:
905: --
940: -- not transfer and return the id of the duplicate record as the Merged To Id
941:
942: if p_from_fk_id <> p_to_fk_id then
943: begin
944: arp_message.set_name('AR','AR_UPDATING_TABLE');
945: arp_message.set_token('TABLE_NAME','OKC_CONTACTS',FALSE);
946: fnd_file.put_line(fnd_file.log, 'Updating Table okc_contacts');
947: --
948: --
941:
942: if p_from_fk_id <> p_to_fk_id then
943: begin
944: arp_message.set_name('AR','AR_UPDATING_TABLE');
945: arp_message.set_token('TABLE_NAME','OKC_CONTACTS',FALSE);
946: fnd_file.put_line(fnd_file.log, 'Updating Table okc_contacts');
947: --
948: --
949: UPDATE okc_contacts ctc
971: --
972: l_count := sql%rowcount;
973:
974: fnd_file.put_line(fnd_file.log, 'No of Rows Updated : '||l_count);
975: arp_message.set_name('AR','AR_ROWS_UPDATED');
976: arp_message.set_token('NUM_ROWS',to_char(l_count));
977: --
978: exception
979: when others then
972: l_count := sql%rowcount;
973:
974: fnd_file.put_line(fnd_file.log, 'No of Rows Updated : '||l_count);
975: arp_message.set_name('AR','AR_ROWS_UPDATED');
976: arp_message.set_token('NUM_ROWS',to_char(l_count));
977: --
978: exception
979: when others then
980: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || sqlerrm);
976: arp_message.set_token('NUM_ROWS',to_char(l_count));
977: --
978: exception
979: when others then
980: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || sqlerrm);
981: --
982: fnd_file.put_line(fnd_file.log,(g_proc_name || '.' || l_api_name ||
983: 'OKC_K_PARTY_ROLES for = ' ||l_object_user_code||'-'|| p_from_id));
984: --