52: txn_type_not_found_error EXCEPTION;
53: RESOURCE_BUSY EXCEPTION;
54: PRAGMA EXCEPTION_INIT(RESOURCE_BUSY, -0054);
55: BEGIN
56: arp_message.set_line('CSI_PARTY_MERGE_PKG.CSI_ITEM_INSTANCES_MERGE()+');
57:
58: x_return_status := FND_API.G_RET_STS_SUCCESS;
59:
60: begin
65: when no_data_found then
66: v_internal_party_message := 'Cannot merge party id '||to_char(p_from_fk_id)||' '||'to party id '||to_char(p_to_fk_id)||'. Data exists in Installed Base, but Install Parameters are not defined';
67: raise internal_party_error;
68: when others then
69: arp_message.set_line(g_proc_name || '.' ||l_api_name || ': ' ||sqlerrm);
70: x_return_status := FND_API.G_RET_STS_ERROR;
71: raise;
72: end;
73:
100: IF p_from_fk_id <> p_to_fk_id then
101: BEGIN
102: If p_parent_entity_name = 'HZ_PARTIES' Then
103:
104: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
105: arp_message.set_token('TABLE_NAME', 'CSI_ITEM_INSTANCES', FALSE);
106:
107: l_column_name := 'owner_party_id';
108:
101: BEGIN
102: If p_parent_entity_name = 'HZ_PARTIES' Then
103:
104: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
105: arp_message.set_token('TABLE_NAME', 'CSI_ITEM_INSTANCES', FALSE);
106:
107: l_column_name := 'owner_party_id';
108:
109: open c1;
118: and owner_party_source_table = v_owner_party_source_table;
119:
120: l_count := sql%rowcount;
121:
122: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
123: arp_message.set_token('NUM_ROWS', to_char(l_count) );
124:
125: Elsif p_parent_entity_name = 'HZ_PARTY_SITES' Then
126:
119:
120: l_count := sql%rowcount;
121:
122: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
123: arp_message.set_token('NUM_ROWS', to_char(l_count) );
124:
125: Elsif p_parent_entity_name = 'HZ_PARTY_SITES' Then
126:
127: /* insert record into transaction table */
231: ( location_type_code = v_install_location_type_code and
232: location_id = p_from_fk_id );
233:
234:
235: arp_message.set_Name('CSI', 'CSI_ROWS_INSERTED');
236:
237: v_no_of_rows := sql%rowcount;
238: arp_message.set_token('NUM_ROWS',to_char(v_no_of_rows));
239: v_error_message := 'Done with the insert of item instance history';
234:
235: arp_message.set_Name('CSI', 'CSI_ROWS_INSERTED');
236:
237: v_no_of_rows := sql%rowcount;
238: arp_message.set_token('NUM_ROWS',to_char(v_no_of_rows));
239: v_error_message := 'Done with the insert of item instance history';
240: arp_message.set_line(v_error_message);
241:
242: /*
236:
237: v_no_of_rows := sql%rowcount;
238: arp_message.set_token('NUM_ROWS',to_char(v_no_of_rows));
239: v_error_message := 'Done with the insert of item instance history';
240: arp_message.set_line(v_error_message);
241:
242: /*
243: After inserting into the history tables for the location(s) update,
244: now update the install_location_id and location_id, if applicable
243: After inserting into the history tables for the location(s) update,
244: now update the install_location_id and location_id, if applicable
245: */
246:
247: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
248: arp_message.set_token('TABLE_NAME', 'CSI_ITEM_INSTANCES', FALSE);
249:
250: l_column_name := 'location_id';
251:
244: now update the install_location_id and location_id, if applicable
245: */
246:
247: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
248: arp_message.set_token('TABLE_NAME', 'CSI_ITEM_INSTANCES', FALSE);
249:
250: l_column_name := 'location_id';
251:
252: open c2;
265: location_id = p_from_fk_id );
266:
267: l_count := sql%rowcount;
268:
269: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
270: arp_message.set_token('NUM_ROWS', to_char(l_count) );
271:
272: End If;
273:
266:
267: l_count := sql%rowcount;
268:
269: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
270: arp_message.set_token('NUM_ROWS', to_char(l_count) );
271:
272: End If;
273:
274: EXCEPTION
272: End If;
273:
274: EXCEPTION
275: when internal_party_error then
276: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || v_internal_party_message);
277: x_return_status := FND_API.G_RET_STS_ERROR;
278: raise;
279: when txn_type_not_found_error then
280: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || v_txn_type_not_found_msg);
276: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || v_internal_party_message);
277: x_return_status := FND_API.G_RET_STS_ERROR;
278: raise;
279: when txn_type_not_found_error then
280: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || v_txn_type_not_found_msg);
281: x_return_status := FND_API.G_RET_STS_ERROR;
282: raise;
283: when resource_busy then
284: arp_message.set_line(g_proc_name || '.' || l_api_name || '; Could not obtain lock for records in table ' || 'CSI_ITEM_INSTANCES for '||l_column_name ||' = '|| p_from_fk_id );
280: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || v_txn_type_not_found_msg);
281: x_return_status := FND_API.G_RET_STS_ERROR;
282: raise;
283: when resource_busy then
284: arp_message.set_line(g_proc_name || '.' || l_api_name || '; Could not obtain lock for records in table ' || 'CSI_ITEM_INSTANCES for '||l_column_name ||' = '|| p_from_fk_id );
285: x_return_status := FND_API.G_RET_STS_ERROR;
286: raise;
287: when others then
288: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || sqlerrm);
284: arp_message.set_line(g_proc_name || '.' || l_api_name || '; Could not obtain lock for records in table ' || 'CSI_ITEM_INSTANCES for '||l_column_name ||' = '|| p_from_fk_id );
285: x_return_status := FND_API.G_RET_STS_ERROR;
286: raise;
287: when others then
288: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || sqlerrm);
289: x_return_status := FND_API.G_RET_STS_ERROR;
290: raise;
291: END;
292: END IF;
332:
333: RESOURCE_BUSY EXCEPTION;
334: PRAGMA EXCEPTION_INIT(RESOURCE_BUSY, -0054);
335: BEGIN
336: arp_message.set_line('CSI_PARTY_MERGE_PKG.CSI_I_PARTIES_MERGE()+');
337:
338: x_return_status := FND_API.G_RET_STS_SUCCESS;
339:
340: begin
345: when no_data_found then
346: v_internal_party_message := 'Cannot merge party id '||to_char(p_from_fk_id)||' '||'to party id '||to_char(p_to_fk_id)||'. Data exists in Installed Base, but Install Parameters are not defined';
347: raise internal_party_error;
348: when others then
349: arp_message.set_line(g_proc_name || '.' ||l_api_name || ': ' ||sqlerrm);
350: x_return_status := FND_API.G_RET_STS_ERROR;
351: raise;
352: end;
353:
473: FROM csi_i_parties cip
474: WHERE cip.party_source_table = v_party_source_table
475: AND cip.party_id = p_from_fk_id;
476:
477: arp_message.set_Name('CSI', 'CSI_ROWS_INSERTED');
478:
479: v_no_of_rows := sql%rowcount;
480: arp_message.set_token('NUM_ROWS',to_char(v_no_of_rows));
481: v_error_message := 'Done with the insert of party history';
476:
477: arp_message.set_Name('CSI', 'CSI_ROWS_INSERTED');
478:
479: v_no_of_rows := sql%rowcount;
480: arp_message.set_token('NUM_ROWS',to_char(v_no_of_rows));
481: v_error_message := 'Done with the insert of party history';
482: arp_message.set_line(v_error_message);
483:
484: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
478:
479: v_no_of_rows := sql%rowcount;
480: arp_message.set_token('NUM_ROWS',to_char(v_no_of_rows));
481: v_error_message := 'Done with the insert of party history';
482: arp_message.set_line(v_error_message);
483:
484: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
485: arp_message.set_token('TABLE_NAME', 'CSI_I_PARTIES', FALSE);
486:
480: arp_message.set_token('NUM_ROWS',to_char(v_no_of_rows));
481: v_error_message := 'Done with the insert of party history';
482: arp_message.set_line(v_error_message);
483:
484: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
485: arp_message.set_token('TABLE_NAME', 'CSI_I_PARTIES', FALSE);
486:
487: l_column_name := 'party_id';
488:
481: v_error_message := 'Done with the insert of party history';
482: arp_message.set_line(v_error_message);
483:
484: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
485: arp_message.set_token('TABLE_NAME', 'CSI_I_PARTIES', FALSE);
486:
487: l_column_name := 'party_id';
488:
489: open c1;
498: and party_source_table = v_party_source_table;
499:
500: l_count := sql%rowcount;
501:
502: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
503: arp_message.set_token('NUM_ROWS', to_char(l_count) );
504:
505: EXCEPTION
506: when internal_party_error then
499:
500: l_count := sql%rowcount;
501:
502: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
503: arp_message.set_token('NUM_ROWS', to_char(l_count) );
504:
505: EXCEPTION
506: when internal_party_error then
507: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' ||v_internal_party_message);
503: arp_message.set_token('NUM_ROWS', to_char(l_count) );
504:
505: EXCEPTION
506: when internal_party_error then
507: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' ||v_internal_party_message);
508: x_return_status := FND_API.G_RET_STS_ERROR;
509: raise;
510: when txn_type_not_found_error then
511: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || v_txn_type_not_found_msg);
507: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' ||v_internal_party_message);
508: x_return_status := FND_API.G_RET_STS_ERROR;
509: raise;
510: when txn_type_not_found_error then
511: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || v_txn_type_not_found_msg);
512: x_return_status := FND_API.G_RET_STS_ERROR;
513: raise;
514: when resource_busy then
515: arp_message.set_line(g_proc_name || '.' || l_api_name || '; Could not obtain lock for records in table ' || 'CSI_I_PARTIES for '||l_column_name ||' = '|| p_from_fk_id );
511: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || v_txn_type_not_found_msg);
512: x_return_status := FND_API.G_RET_STS_ERROR;
513: raise;
514: when resource_busy then
515: arp_message.set_line(g_proc_name || '.' || l_api_name || '; Could not obtain lock for records in table ' || 'CSI_I_PARTIES for '||l_column_name ||' = '|| p_from_fk_id );
516: x_return_status := FND_API.G_RET_STS_ERROR;
517: raise;
518: when others then
519: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || sqlerrm);
515: arp_message.set_line(g_proc_name || '.' || l_api_name || '; Could not obtain lock for records in table ' || 'CSI_I_PARTIES for '||l_column_name ||' = '|| p_from_fk_id );
516: x_return_status := FND_API.G_RET_STS_ERROR;
517: raise;
518: when others then
519: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || sqlerrm);
520: x_return_status := FND_API.G_RET_STS_ERROR;
521: raise;
522: END;
523: END IF;
569: RESOURCE_BUSY EXCEPTION;
570: PRAGMA EXCEPTION_INIT(RESOURCE_BUSY, -0054);
571:
572: BEGIN
573: arp_message.set_line('CSI_PARTY_MERGE_PKG.CSI_SYSTEMS_B_MERGE()+');
574:
575: x_return_status := FND_API.G_RET_STS_SUCCESS;
576:
577: begin
582: when no_data_found then
583: v_internal_party_message := 'Cannot merge party id '||to_char(p_from_fk_id)||' '||'to party id '||to_char(p_to_fk_id)||'. Data exists in Installed Base, but Install Parameters are not defined';
584: raise internal_party_error;
585: when others then
586: arp_message.set_line(g_proc_name || '.' ||l_api_name || ': ' ||sqlerrm);
587: x_return_status := FND_API.G_RET_STS_ERROR;
588: raise;
589: end;
590:
707: 1
708: FROM csi_systems_b csb
709: WHERE csb.install_site_use_id = p_from_fk_id;
710:
711: arp_message.set_Name('CSI', 'CSI_ROWS_INSERTED');
712:
713: v_no_of_rows := sql%rowcount;
714: arp_message.set_token('NUM_ROWS',to_char(v_no_of_rows));
715: v_error_message := 'Done with the insert of systems history';
710:
711: arp_message.set_Name('CSI', 'CSI_ROWS_INSERTED');
712:
713: v_no_of_rows := sql%rowcount;
714: arp_message.set_token('NUM_ROWS',to_char(v_no_of_rows));
715: v_error_message := 'Done with the insert of systems history';
716: arp_message.set_line(v_error_message);
717:
718: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
712:
713: v_no_of_rows := sql%rowcount;
714: arp_message.set_token('NUM_ROWS',to_char(v_no_of_rows));
715: v_error_message := 'Done with the insert of systems history';
716: arp_message.set_line(v_error_message);
717:
718: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
719: arp_message.set_token('TABLE_NAME', 'CSI_SYSTEMS_B', FALSE);
720:
714: arp_message.set_token('NUM_ROWS',to_char(v_no_of_rows));
715: v_error_message := 'Done with the insert of systems history';
716: arp_message.set_line(v_error_message);
717:
718: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
719: arp_message.set_token('TABLE_NAME', 'CSI_SYSTEMS_B', FALSE);
720:
721: l_column_name := 'install_site_use_id';
722:
715: v_error_message := 'Done with the insert of systems history';
716: arp_message.set_line(v_error_message);
717:
718: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
719: arp_message.set_token('TABLE_NAME', 'CSI_SYSTEMS_B', FALSE);
720:
721: l_column_name := 'install_site_use_id';
722:
723: open c1;
731: where install_site_use_id = p_from_fk_id;
732:
733: l_count := sql%rowcount;
734:
735: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
736: arp_message.set_token('NUM_ROWS', to_char(l_count) );
737:
738: Elsif p_parent_entity_name = 'HZ_PARTIES' Then
739:
732:
733: l_count := sql%rowcount;
734:
735: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
736: arp_message.set_token('NUM_ROWS', to_char(l_count) );
737:
738: Elsif p_parent_entity_name = 'HZ_PARTIES' Then
739:
740: v_no_of_rows := 0;
783: OR bill_to_contact_id = p_from_fk_id
784: OR technical_contact_id = p_from_fk_id
785: OR service_admin_contact_id = p_from_fk_id ;
786:
787: arp_message.set_Name('CSI', 'CSI_ROWS_INSERTED');
788:
789: v_no_of_rows := sql%rowcount;
790: arp_message.set_token('NUM_ROWS',to_char(v_no_of_rows));
791: v_error_message := 'Done with the insert of systems history';
786:
787: arp_message.set_Name('CSI', 'CSI_ROWS_INSERTED');
788:
789: v_no_of_rows := sql%rowcount;
790: arp_message.set_token('NUM_ROWS',to_char(v_no_of_rows));
791: v_error_message := 'Done with the insert of systems history';
792: arp_message.set_line(v_error_message);
793:
794: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
788:
789: v_no_of_rows := sql%rowcount;
790: arp_message.set_token('NUM_ROWS',to_char(v_no_of_rows));
791: v_error_message := 'Done with the insert of systems history';
792: arp_message.set_line(v_error_message);
793:
794: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
795: arp_message.set_token('TABLE_NAME', 'CSI_SYSTEMS_B', FALSE);
796:
790: arp_message.set_token('NUM_ROWS',to_char(v_no_of_rows));
791: v_error_message := 'Done with the insert of systems history';
792: arp_message.set_line(v_error_message);
793:
794: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
795: arp_message.set_token('TABLE_NAME', 'CSI_SYSTEMS_B', FALSE);
796:
797: l_column_name := 'contact_ids';
798:
791: v_error_message := 'Done with the insert of systems history';
792: arp_message.set_line(v_error_message);
793:
794: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
795: arp_message.set_token('TABLE_NAME', 'CSI_SYSTEMS_B', FALSE);
796:
797: l_column_name := 'contact_ids';
798:
799: open c2;
816: or service_admin_contact_id = p_from_fk_id ;
817:
818: l_count := sql%rowcount;
819:
820: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
821: arp_message.set_token('NUM_ROWS', to_char(l_count) );
822:
823: End If;
824:
817:
818: l_count := sql%rowcount;
819:
820: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
821: arp_message.set_token('NUM_ROWS', to_char(l_count) );
822:
823: End If;
824:
825: EXCEPTION
823: End If;
824:
825: EXCEPTION
826: when internal_party_error then
827: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' ||v_internal_party_message);
828: x_return_status := FND_API.G_RET_STS_ERROR;
829: raise;
830: when txn_type_not_found_error then
831: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || v_txn_type_not_found_msg);
827: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' ||v_internal_party_message);
828: x_return_status := FND_API.G_RET_STS_ERROR;
829: raise;
830: when txn_type_not_found_error then
831: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || v_txn_type_not_found_msg);
832: x_return_status := FND_API.G_RET_STS_ERROR;
833: raise;
834: when resource_busy then
835: arp_message.set_line(g_proc_name || '.' || l_api_name || '; Could not obtain lock for records in table ' || 'CSI_SYSTEMS_B for '||l_column_name ||' = '|| p_from_fk_id );
831: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || v_txn_type_not_found_msg);
832: x_return_status := FND_API.G_RET_STS_ERROR;
833: raise;
834: when resource_busy then
835: arp_message.set_line(g_proc_name || '.' || l_api_name || '; Could not obtain lock for records in table ' || 'CSI_SYSTEMS_B for '||l_column_name ||' = '|| p_from_fk_id );
836: x_return_status := FND_API.G_RET_STS_ERROR;
837: raise;
838:
839: when others then
836: x_return_status := FND_API.G_RET_STS_ERROR;
837: raise;
838:
839: when others then
840: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || sqlerrm);
841: x_return_status := FND_API.G_RET_STS_ERROR;
842: raise;
843: END;
844: end if;
885: RESOURCE_BUSY EXCEPTION;
886: PRAGMA EXCEPTION_INIT(RESOURCE_BUSY, -0054);
887:
888: BEGIN
889: arp_message.set_line('CSI_PARTY_MERGE_PKG.CSI_T_TXN_SYSTEMS_MERGE()+');
890:
891: x_return_status := FND_API.G_RET_STS_SUCCESS;
892:
893: begin
898: when no_data_found then
899: v_internal_party_message := 'Cannot merge party id '||to_char(p_from_fk_id)||' '||'to party id '||to_char(p_to_fk_id)||'. Data exists in Installed Base, but Install Parameters are not defined';
900: raise internal_party_error;
901: when others then
902: arp_message.set_line(g_proc_name || '.' ||l_api_name || ': ' ||sqlerrm);
903: x_return_status := FND_API.G_RET_STS_ERROR;
904: raise;
905: end;
906:
934: begin
935:
936: If p_parent_entity_name = 'HZ_PARTY_SITES' Then
937:
938: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
939: arp_message.set_token('TABLE_NAME', 'CSI_T_TXN_SYSTEMS', FALSE);
940:
941: l_column_name := 'install_site_use_id';
942:
935:
936: If p_parent_entity_name = 'HZ_PARTY_SITES' Then
937:
938: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
939: arp_message.set_token('TABLE_NAME', 'CSI_T_TXN_SYSTEMS', FALSE);
940:
941: l_column_name := 'install_site_use_id';
942:
943: open c1;
951: where install_site_use_id = p_from_fk_id;
952:
953: l_count := sql%rowcount;
954:
955: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
956: arp_message.set_token('NUM_ROWS', to_char(l_count) );
957:
958: Elsif p_parent_entity_name = 'HZ_PARTIES' Then
959:
952:
953: l_count := sql%rowcount;
954:
955: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
956: arp_message.set_token('NUM_ROWS', to_char(l_count) );
957:
958: Elsif p_parent_entity_name = 'HZ_PARTIES' Then
959:
960: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
956: arp_message.set_token('NUM_ROWS', to_char(l_count) );
957:
958: Elsif p_parent_entity_name = 'HZ_PARTIES' Then
959:
960: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
961: arp_message.set_token('TABLE_NAME', 'CSI_T_TXN_SYSTEMS', FALSE);
962:
963: l_column_name := 'contact_ids';
964:
957:
958: Elsif p_parent_entity_name = 'HZ_PARTIES' Then
959:
960: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
961: arp_message.set_token('TABLE_NAME', 'CSI_T_TXN_SYSTEMS', FALSE);
962:
963: l_column_name := 'contact_ids';
964:
965: open c2;
980: or service_admin_contact_id = p_from_fk_id;
981:
982: l_count := sql%rowcount;
983:
984: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
985: arp_message.set_token('NUM_ROWS', to_char(l_count) );
986:
987: End If;
988:
981:
982: l_count := sql%rowcount;
983:
984: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
985: arp_message.set_token('NUM_ROWS', to_char(l_count) );
986:
987: End If;
988:
989: EXCEPTION
987: End If;
988:
989: EXCEPTION
990: when internal_party_error then
991: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' ||v_internal_party_message);
992: x_return_status := FND_API.G_RET_STS_ERROR;
993: raise;
994: when resource_busy then
995: arp_message.set_line(g_proc_name || '.' || l_api_name || '; Could not obtain lock for records in table ' || 'CSI_T_TXN_SYSTEMS for '||l_column_name ||' = '|| p_from_fk_id );
991: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' ||v_internal_party_message);
992: x_return_status := FND_API.G_RET_STS_ERROR;
993: raise;
994: when resource_busy then
995: arp_message.set_line(g_proc_name || '.' || l_api_name || '; Could not obtain lock for records in table ' || 'CSI_T_TXN_SYSTEMS for '||l_column_name ||' = '|| p_from_fk_id );
996: x_return_status := FND_API.G_RET_STS_ERROR;
997: raise;
998: when others then
999: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || sqlerrm);
995: arp_message.set_line(g_proc_name || '.' || l_api_name || '; Could not obtain lock for records in table ' || 'CSI_T_TXN_SYSTEMS for '||l_column_name ||' = '|| p_from_fk_id );
996: x_return_status := FND_API.G_RET_STS_ERROR;
997: raise;
998: when others then
999: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || sqlerrm);
1000: x_return_status := FND_API.G_RET_STS_ERROR;
1001: raise;
1002: END;
1003:
1038:
1039: RESOURCE_BUSY EXCEPTION;
1040: PRAGMA EXCEPTION_INIT(RESOURCE_BUSY, -0054);
1041: BEGIN
1042: arp_message.set_line('CSI_PARTY_MERGE_PKG.CSI_T_PARTY_DETAILS_MERGE()+');
1043:
1044: x_return_status := FND_API.G_RET_STS_SUCCESS;
1045:
1046: begin
1051: when no_data_found then
1052: v_internal_party_message := 'Cannot merge party id '||to_char(p_from_fk_id)||' '||'to party id '||to_char(p_to_fk_id)||'. Data exists in Installed Base, but Install Parameters are not defined';
1053: raise internal_party_error;
1054: when others then
1055: arp_message.set_line(g_proc_name || '.' ||l_api_name || ': ' ||sqlerrm);
1056: x_return_status := FND_API.G_RET_STS_ERROR;
1057: raise;
1058: end;
1059:
1086: IF p_from_fk_id <> p_to_fk_id then
1087:
1088: BEGIN
1089:
1090: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
1091: arp_message.set_token('TABLE_NAME', 'CSI_T_PARTY_DETAILS', FALSE);
1092: l_column_name := 'party_source_id';
1093:
1094: open c1;
1087:
1088: BEGIN
1089:
1090: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
1091: arp_message.set_token('TABLE_NAME', 'CSI_T_PARTY_DETAILS', FALSE);
1092: l_column_name := 'party_source_id';
1093:
1094: open c1;
1095: close c1;
1103: and party_source_table = v_party_source_table;
1104:
1105: l_count := sql%rowcount;
1106:
1107: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
1108: arp_message.set_token('NUM_ROWS', to_char(l_count) );
1109:
1110: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
1111: arp_message.set_token('TABLE_NAME', 'CSI_T_PARTY_DETAILS', FALSE);
1104:
1105: l_count := sql%rowcount;
1106:
1107: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
1108: arp_message.set_token('NUM_ROWS', to_char(l_count) );
1109:
1110: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
1111: arp_message.set_token('TABLE_NAME', 'CSI_T_PARTY_DETAILS', FALSE);
1112:
1106:
1107: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
1108: arp_message.set_token('NUM_ROWS', to_char(l_count) );
1109:
1110: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
1111: arp_message.set_token('TABLE_NAME', 'CSI_T_PARTY_DETAILS', FALSE);
1112:
1113: l_column_name := 'contact_party_id';
1114:
1107: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
1108: arp_message.set_token('NUM_ROWS', to_char(l_count) );
1109:
1110: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
1111: arp_message.set_token('TABLE_NAME', 'CSI_T_PARTY_DETAILS', FALSE);
1112:
1113: l_column_name := 'contact_party_id';
1114:
1115: EXCEPTION
1113: l_column_name := 'contact_party_id';
1114:
1115: EXCEPTION
1116: when internal_party_error then
1117: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' ||v_internal_party_message);
1118: x_return_status := FND_API.G_RET_STS_ERROR;
1119: raise;
1120: when resource_busy then
1121: arp_message.set_line(g_proc_name || '.' || l_api_name || '; Could not obtain lock for records in table ' || 'CSI_T_PARTY_DETAILS for '||l_column_name ||' = '|| p_from_fk_id );
1117: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' ||v_internal_party_message);
1118: x_return_status := FND_API.G_RET_STS_ERROR;
1119: raise;
1120: when resource_busy then
1121: arp_message.set_line(g_proc_name || '.' || l_api_name || '; Could not obtain lock for records in table ' || 'CSI_T_PARTY_DETAILS for '||l_column_name ||' = '|| p_from_fk_id );
1122: x_return_status := FND_API.G_RET_STS_ERROR;
1123: raise;
1124: when others then
1125: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || sqlerrm);
1121: arp_message.set_line(g_proc_name || '.' || l_api_name || '; Could not obtain lock for records in table ' || 'CSI_T_PARTY_DETAILS for '||l_column_name ||' = '|| p_from_fk_id );
1122: x_return_status := FND_API.G_RET_STS_ERROR;
1123: raise;
1124: when others then
1125: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || sqlerrm);
1126: x_return_status := FND_API.G_RET_STS_ERROR;
1127: raise;
1128: END;
1129: END IF;
1165:
1166: RESOURCE_BUSY EXCEPTION;
1167: PRAGMA EXCEPTION_INIT(RESOURCE_BUSY, -0054);
1168: BEGIN
1169: arp_message.set_line('CSI_PARTY_MERGE_PKG.CSI_T_TXN_LINE_DETAILS_MERGE()+');
1170:
1171: x_return_status := FND_API.G_RET_STS_SUCCESS;
1172:
1173: select merge_reason_code
1190: end if;
1191:
1192: IF p_from_fk_id <> p_to_fk_id then
1193: BEGIN
1194: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
1195: arp_message.set_token('TABLE_NAME', 'CSI_T_TXN_LINE_DETAILS', FALSE);
1196: l_column_name := 'location_id';
1197:
1198: open c1;
1191:
1192: IF p_from_fk_id <> p_to_fk_id then
1193: BEGIN
1194: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
1195: arp_message.set_token('TABLE_NAME', 'CSI_T_TXN_LINE_DETAILS', FALSE);
1196: l_column_name := 'location_id';
1197:
1198: open c1;
1199: close c1;
1208: or ( install_location_id = p_from_fk_id and install_location_type_code = v_location_type_code );
1209:
1210: l_count := sql%rowcount;
1211:
1212: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
1213: arp_message.set_token('NUM_ROWS', to_char(l_count) );
1214:
1215: EXCEPTION
1216: when internal_party_error then
1209:
1210: l_count := sql%rowcount;
1211:
1212: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
1213: arp_message.set_token('NUM_ROWS', to_char(l_count) );
1214:
1215: EXCEPTION
1216: when internal_party_error then
1217: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || v_internal_party_message);
1213: arp_message.set_token('NUM_ROWS', to_char(l_count) );
1214:
1215: EXCEPTION
1216: when internal_party_error then
1217: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || v_internal_party_message);
1218: x_return_status := FND_API.G_RET_STS_ERROR;
1219: raise;
1220: when resource_busy then
1221: arp_message.set_line(g_proc_name || '.' || l_api_name || '; Could not obtain lock for records in table ' || 'CSI_T_TXN_LINE_DETAILS for '||l_column_name ||' = '|| p_from_fk_id );
1217: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || v_internal_party_message);
1218: x_return_status := FND_API.G_RET_STS_ERROR;
1219: raise;
1220: when resource_busy then
1221: arp_message.set_line(g_proc_name || '.' || l_api_name || '; Could not obtain lock for records in table ' || 'CSI_T_TXN_LINE_DETAILS for '||l_column_name ||' = '|| p_from_fk_id );
1222: x_return_status := FND_API.G_RET_STS_ERROR;
1223: raise;
1224: when others then
1225: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || sqlerrm);
1221: arp_message.set_line(g_proc_name || '.' || l_api_name || '; Could not obtain lock for records in table ' || 'CSI_T_TXN_LINE_DETAILS for '||l_column_name ||' = '|| p_from_fk_id );
1222: x_return_status := FND_API.G_RET_STS_ERROR;
1223: raise;
1224: when others then
1225: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || sqlerrm);
1226: x_return_status := FND_API.G_RET_STS_ERROR;
1227: raise;
1228: END;
1229: END IF;