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: csi_t_gen_utility_pvt.g_debug_level := 10;
59: csi_t_gen_utility_pvt.build_file_name( p_file_segment1 => 'csipartymeg',
60: p_file_segment2 => TO_CHAR(SYSDATE, 'mmddyy'));
80: when no_data_found then
81: 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';
82: raise internal_party_error;
83: when others then
84: arp_message.set_line(g_proc_name || '.' ||l_api_name || ': ' ||sqlerrm);
85: x_return_status := FND_API.G_RET_STS_ERROR;
86: raise;
87: end;
88:
123:
124: csi_t_gen_utility_pvt.ADD('Party Merge ');
125:
126:
127: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
128: arp_message.set_token('TABLE_NAME', 'CSI_ITEM_INSTANCES', FALSE);
129:
130: l_column_name := 'owner_party_id';
131:
124: csi_t_gen_utility_pvt.ADD('Party Merge ');
125:
126:
127: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
128: arp_message.set_token('TABLE_NAME', 'CSI_ITEM_INSTANCES', FALSE);
129:
130: l_column_name := 'owner_party_id';
131:
132: open c1;
141: and owner_party_source_table = v_owner_party_source_table;
142:
143: l_count := sql%rowcount;
144:
145: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
146: arp_message.set_token('NUM_ROWS', to_char(l_count) );
147:
148: Elsif p_parent_entity_name = 'HZ_PARTY_SITES' Then
149:
142:
143: l_count := sql%rowcount;
144:
145: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
146: arp_message.set_token('NUM_ROWS', to_char(l_count) );
147:
148: Elsif p_parent_entity_name = 'HZ_PARTY_SITES' Then
149:
150: csi_t_gen_utility_pvt.ADD('Party site merge');
262: ( location_type_code = v_location_type_code and
263: location_id = p_from_fk_id );
264:
265:
266: arp_message.set_Name('CSI', 'CSI_ROWS_INSERTED');
267:
268: v_no_of_rows := sql%rowcount;
269: arp_message.set_token('NUM_ROWS',to_char(v_no_of_rows));
270: v_error_message := 'Done with the insert of item instance history';
265:
266: arp_message.set_Name('CSI', 'CSI_ROWS_INSERTED');
267:
268: v_no_of_rows := sql%rowcount;
269: arp_message.set_token('NUM_ROWS',to_char(v_no_of_rows));
270: v_error_message := 'Done with the insert of item instance history';
271: arp_message.set_line(v_error_message);
272:
273: csi_t_gen_utility_pvt.ADD('Done with the insert of item instance history ');
267:
268: v_no_of_rows := sql%rowcount;
269: arp_message.set_token('NUM_ROWS',to_char(v_no_of_rows));
270: v_error_message := 'Done with the insert of item instance history';
271: arp_message.set_line(v_error_message);
272:
273: csi_t_gen_utility_pvt.ADD('Done with the insert of item instance history ');
274: csi_t_gen_utility_pvt.ADD('Num of history row updated: '||v_no_of_rows);
275:
287: WHERE(cii2.new_location_id = p_from_fk_id OR cii2.new_inst_loc_id = p_from_fk_id)
288: AND cii2.transaction_id = v_transaction_id);
289: EXCEPTION
290: WHEN others THEN
291: arp_message.set_line(g_proc_name || '.' || l_api_name || ': '
292: || sqlerrm);
293: x_return_status := FND_API.G_RET_STS_ERROR;
294: raise;
295: END;
294: raise;
295: END;
296:
297: WHEN others THEN
298: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' ||
299: sqlerrm);
300: x_return_status := FND_API.G_RET_STS_ERROR;
301: raise;
302:
305: After inserting into the history tables for the location(s) update,
306: now update the install_location_id and location_id, if applicable
307: */
308:
309: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
310: arp_message.set_token('TABLE_NAME', 'CSI_ITEM_INSTANCES', FALSE);
311:
312: l_column_name := 'location_id';
313:
306: now update the install_location_id and location_id, if applicable
307: */
308:
309: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
310: arp_message.set_token('TABLE_NAME', 'CSI_ITEM_INSTANCES', FALSE);
311:
312: l_column_name := 'location_id';
313:
314: open c2;
327: location_id = p_from_fk_id );
328:
329: l_count := sql%rowcount;
330:
331: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
332: arp_message.set_token('NUM_ROWS', to_char(l_count) );
333:
334: csi_t_gen_utility_pvt.ADD('Num of instance row updated: '||v_no_of_rows);
335:
328:
329: l_count := sql%rowcount;
330:
331: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
332: arp_message.set_token('NUM_ROWS', to_char(l_count) );
333:
334: csi_t_gen_utility_pvt.ADD('Num of instance row updated: '||v_no_of_rows);
335:
336:
337: End If;
338:
339: EXCEPTION
340: when internal_party_error then
341: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || v_internal_party_message);
342: x_return_status := FND_API.G_RET_STS_ERROR;
343: raise;
344: when txn_type_not_found_error then
345: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || v_txn_type_not_found_msg);
341: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || v_internal_party_message);
342: x_return_status := FND_API.G_RET_STS_ERROR;
343: raise;
344: when txn_type_not_found_error then
345: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || v_txn_type_not_found_msg);
346: x_return_status := FND_API.G_RET_STS_ERROR;
347: raise;
348: when resource_busy then
349: 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 );
345: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || v_txn_type_not_found_msg);
346: x_return_status := FND_API.G_RET_STS_ERROR;
347: raise;
348: when resource_busy then
349: 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 );
350: x_return_status := FND_API.G_RET_STS_ERROR;
351: raise;
352: when others then
353: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || sqlerrm);
349: 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 );
350: x_return_status := FND_API.G_RET_STS_ERROR;
351: raise;
352: when others then
353: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || sqlerrm);
354: x_return_status := FND_API.G_RET_STS_ERROR;
355: raise;
356: END;
357: END IF;
397:
398: RESOURCE_BUSY EXCEPTION;
399: PRAGMA EXCEPTION_INIT(RESOURCE_BUSY, -0054);
400: BEGIN
401: arp_message.set_line('CSI_PARTY_MERGE_PKG.CSI_I_PARTIES_MERGE()+');
402:
403: csi_t_gen_utility_pvt.ADD('Inside CSI_PARTY_MERGE_PKG.CSI_I_PARTIES_MERGE');
404:
405: x_return_status := FND_API.G_RET_STS_SUCCESS;
412: when no_data_found then
413: 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';
414: raise internal_party_error;
415: when others then
416: arp_message.set_line(g_proc_name || '.' ||l_api_name || ': ' ||sqlerrm);
417: x_return_status := FND_API.G_RET_STS_ERROR;
418: raise;
419: end;
420:
543: FROM csi_i_parties cip
544: WHERE cip.party_source_table = v_party_source_table
545: AND cip.party_id = p_from_fk_id;
546:
547: arp_message.set_Name('CSI', 'CSI_ROWS_INSERTED');
548:
549: v_no_of_rows := sql%rowcount;
550: arp_message.set_token('NUM_ROWS',to_char(v_no_of_rows));
551: v_error_message := 'Done with the insert of party history';
546:
547: arp_message.set_Name('CSI', 'CSI_ROWS_INSERTED');
548:
549: v_no_of_rows := sql%rowcount;
550: arp_message.set_token('NUM_ROWS',to_char(v_no_of_rows));
551: v_error_message := 'Done with the insert of party history';
552: arp_message.set_line(v_error_message);
553:
554: csi_t_gen_utility_pvt.ADD('Party history row updated'|| v_no_of_rows);
548:
549: v_no_of_rows := sql%rowcount;
550: arp_message.set_token('NUM_ROWS',to_char(v_no_of_rows));
551: v_error_message := 'Done with the insert of party history';
552: arp_message.set_line(v_error_message);
553:
554: csi_t_gen_utility_pvt.ADD('Party history row updated'|| v_no_of_rows);
555:
556: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
552: arp_message.set_line(v_error_message);
553:
554: csi_t_gen_utility_pvt.ADD('Party history row updated'|| v_no_of_rows);
555:
556: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
557: arp_message.set_token('TABLE_NAME', 'CSI_I_PARTIES', FALSE);
558:
559: l_column_name := 'party_id';
560:
553:
554: csi_t_gen_utility_pvt.ADD('Party history row updated'|| v_no_of_rows);
555:
556: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
557: arp_message.set_token('TABLE_NAME', 'CSI_I_PARTIES', FALSE);
558:
559: l_column_name := 'party_id';
560:
561: open c1;
572: l_count := sql%rowcount;
573:
574: csi_t_gen_utility_pvt.ADD('Party row updated'||l_count);
575:
576: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
577: arp_message.set_token('NUM_ROWS', to_char(l_count) );
578:
579: EXCEPTION
580: when internal_party_error then
573:
574: csi_t_gen_utility_pvt.ADD('Party row updated'||l_count);
575:
576: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
577: arp_message.set_token('NUM_ROWS', to_char(l_count) );
578:
579: EXCEPTION
580: when internal_party_error then
581: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' ||v_internal_party_message);
577: arp_message.set_token('NUM_ROWS', to_char(l_count) );
578:
579: EXCEPTION
580: when internal_party_error then
581: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' ||v_internal_party_message);
582: x_return_status := FND_API.G_RET_STS_ERROR;
583: raise;
584: when txn_type_not_found_error then
585: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || v_txn_type_not_found_msg);
581: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' ||v_internal_party_message);
582: x_return_status := FND_API.G_RET_STS_ERROR;
583: raise;
584: when txn_type_not_found_error then
585: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || v_txn_type_not_found_msg);
586: x_return_status := FND_API.G_RET_STS_ERROR;
587: raise;
588: when resource_busy then
589: 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 );
585: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || v_txn_type_not_found_msg);
586: x_return_status := FND_API.G_RET_STS_ERROR;
587: raise;
588: when resource_busy then
589: 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 );
590: x_return_status := FND_API.G_RET_STS_ERROR;
591: raise;
592: when others then
593: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || sqlerrm);
589: 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 );
590: x_return_status := FND_API.G_RET_STS_ERROR;
591: raise;
592: when others then
593: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || sqlerrm);
594: x_return_status := FND_API.G_RET_STS_ERROR;
595: raise;
596: END;
597: END IF;
643: RESOURCE_BUSY EXCEPTION;
644: PRAGMA EXCEPTION_INIT(RESOURCE_BUSY, -0054);
645:
646: BEGIN
647: arp_message.set_line('CSI_PARTY_MERGE_PKG.CSI_SYSTEMS_B_MERGE()+');
648:
649: x_return_status := FND_API.G_RET_STS_SUCCESS;
650:
651: begin
656: when no_data_found then
657: 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';
658: raise internal_party_error;
659: when others then
660: arp_message.set_line(g_proc_name || '.' ||l_api_name || ': ' ||sqlerrm);
661: x_return_status := FND_API.G_RET_STS_ERROR;
662: raise;
663: end;
664:
781: 1
782: FROM csi_systems_b csb
783: WHERE csb.install_site_use_id = p_from_fk_id;
784:
785: arp_message.set_Name('CSI', 'CSI_ROWS_INSERTED');
786:
787: v_no_of_rows := sql%rowcount;
788: arp_message.set_token('NUM_ROWS',to_char(v_no_of_rows));
789: v_error_message := 'Done with the insert of systems history';
784:
785: arp_message.set_Name('CSI', 'CSI_ROWS_INSERTED');
786:
787: v_no_of_rows := sql%rowcount;
788: arp_message.set_token('NUM_ROWS',to_char(v_no_of_rows));
789: v_error_message := 'Done with the insert of systems history';
790: arp_message.set_line(v_error_message);
791:
792: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
786:
787: v_no_of_rows := sql%rowcount;
788: arp_message.set_token('NUM_ROWS',to_char(v_no_of_rows));
789: v_error_message := 'Done with the insert of systems history';
790: arp_message.set_line(v_error_message);
791:
792: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
793: arp_message.set_token('TABLE_NAME', 'CSI_SYSTEMS_B', FALSE);
794:
788: arp_message.set_token('NUM_ROWS',to_char(v_no_of_rows));
789: v_error_message := 'Done with the insert of systems history';
790: arp_message.set_line(v_error_message);
791:
792: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
793: arp_message.set_token('TABLE_NAME', 'CSI_SYSTEMS_B', FALSE);
794:
795: l_column_name := 'install_site_use_id';
796:
789: v_error_message := 'Done with the insert of systems history';
790: arp_message.set_line(v_error_message);
791:
792: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
793: arp_message.set_token('TABLE_NAME', 'CSI_SYSTEMS_B', FALSE);
794:
795: l_column_name := 'install_site_use_id';
796:
797: open c1;
805: where install_site_use_id = p_from_fk_id;
806:
807: l_count := sql%rowcount;
808:
809: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
810: arp_message.set_token('NUM_ROWS', to_char(l_count) );
811:
812: Elsif p_parent_entity_name = 'HZ_PARTIES' Then
813:
806:
807: l_count := sql%rowcount;
808:
809: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
810: arp_message.set_token('NUM_ROWS', to_char(l_count) );
811:
812: Elsif p_parent_entity_name = 'HZ_PARTIES' Then
813:
814: v_no_of_rows := 0;
857: OR bill_to_contact_id = p_from_fk_id
858: OR technical_contact_id = p_from_fk_id
859: OR service_admin_contact_id = p_from_fk_id ;
860:
861: arp_message.set_Name('CSI', 'CSI_ROWS_INSERTED');
862:
863: v_no_of_rows := sql%rowcount;
864: arp_message.set_token('NUM_ROWS',to_char(v_no_of_rows));
865: v_error_message := 'Done with the insert of systems history';
860:
861: arp_message.set_Name('CSI', 'CSI_ROWS_INSERTED');
862:
863: v_no_of_rows := sql%rowcount;
864: arp_message.set_token('NUM_ROWS',to_char(v_no_of_rows));
865: v_error_message := 'Done with the insert of systems history';
866: arp_message.set_line(v_error_message);
867:
868: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
862:
863: v_no_of_rows := sql%rowcount;
864: arp_message.set_token('NUM_ROWS',to_char(v_no_of_rows));
865: v_error_message := 'Done with the insert of systems history';
866: arp_message.set_line(v_error_message);
867:
868: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
869: arp_message.set_token('TABLE_NAME', 'CSI_SYSTEMS_B', FALSE);
870:
864: arp_message.set_token('NUM_ROWS',to_char(v_no_of_rows));
865: v_error_message := 'Done with the insert of systems history';
866: arp_message.set_line(v_error_message);
867:
868: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
869: arp_message.set_token('TABLE_NAME', 'CSI_SYSTEMS_B', FALSE);
870:
871: l_column_name := 'contact_ids';
872:
865: v_error_message := 'Done with the insert of systems history';
866: arp_message.set_line(v_error_message);
867:
868: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
869: arp_message.set_token('TABLE_NAME', 'CSI_SYSTEMS_B', FALSE);
870:
871: l_column_name := 'contact_ids';
872:
873: open c2;
890: or service_admin_contact_id = p_from_fk_id ;
891:
892: l_count := sql%rowcount;
893:
894: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
895: arp_message.set_token('NUM_ROWS', to_char(l_count) );
896:
897: End If;
898:
891:
892: l_count := sql%rowcount;
893:
894: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
895: arp_message.set_token('NUM_ROWS', to_char(l_count) );
896:
897: End If;
898:
899: EXCEPTION
897: End If;
898:
899: EXCEPTION
900: when internal_party_error then
901: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' ||v_internal_party_message);
902: x_return_status := FND_API.G_RET_STS_ERROR;
903: raise;
904: when txn_type_not_found_error then
905: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || v_txn_type_not_found_msg);
901: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' ||v_internal_party_message);
902: x_return_status := FND_API.G_RET_STS_ERROR;
903: raise;
904: when txn_type_not_found_error then
905: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || v_txn_type_not_found_msg);
906: x_return_status := FND_API.G_RET_STS_ERROR;
907: raise;
908: when resource_busy then
909: 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 );
905: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || v_txn_type_not_found_msg);
906: x_return_status := FND_API.G_RET_STS_ERROR;
907: raise;
908: when resource_busy then
909: 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 );
910: x_return_status := FND_API.G_RET_STS_ERROR;
911: raise;
912:
913: when others then
910: x_return_status := FND_API.G_RET_STS_ERROR;
911: raise;
912:
913: when others then
914: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || sqlerrm);
915: x_return_status := FND_API.G_RET_STS_ERROR;
916: raise;
917: END;
918: end if;
959: RESOURCE_BUSY EXCEPTION;
960: PRAGMA EXCEPTION_INIT(RESOURCE_BUSY, -0054);
961:
962: BEGIN
963: arp_message.set_line('CSI_PARTY_MERGE_PKG.CSI_T_TXN_SYSTEMS_MERGE()+');
964:
965: x_return_status := FND_API.G_RET_STS_SUCCESS;
966:
967: begin
972: when no_data_found then
973: 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';
974: raise internal_party_error;
975: when others then
976: arp_message.set_line(g_proc_name || '.' ||l_api_name || ': ' ||sqlerrm);
977: x_return_status := FND_API.G_RET_STS_ERROR;
978: raise;
979: end;
980:
1008: begin
1009:
1010: If p_parent_entity_name = 'HZ_PARTY_SITES' Then
1011:
1012: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
1013: arp_message.set_token('TABLE_NAME', 'CSI_T_TXN_SYSTEMS', FALSE);
1014:
1015: l_column_name := 'install_site_use_id';
1016:
1009:
1010: If p_parent_entity_name = 'HZ_PARTY_SITES' Then
1011:
1012: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
1013: arp_message.set_token('TABLE_NAME', 'CSI_T_TXN_SYSTEMS', FALSE);
1014:
1015: l_column_name := 'install_site_use_id';
1016:
1017: open c1;
1025: where install_site_use_id = p_from_fk_id;
1026:
1027: l_count := sql%rowcount;
1028:
1029: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
1030: arp_message.set_token('NUM_ROWS', to_char(l_count) );
1031:
1032: Elsif p_parent_entity_name = 'HZ_PARTIES' Then
1033:
1026:
1027: l_count := sql%rowcount;
1028:
1029: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
1030: arp_message.set_token('NUM_ROWS', to_char(l_count) );
1031:
1032: Elsif p_parent_entity_name = 'HZ_PARTIES' Then
1033:
1034: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
1030: arp_message.set_token('NUM_ROWS', to_char(l_count) );
1031:
1032: Elsif p_parent_entity_name = 'HZ_PARTIES' Then
1033:
1034: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
1035: arp_message.set_token('TABLE_NAME', 'CSI_T_TXN_SYSTEMS', FALSE);
1036:
1037: l_column_name := 'contact_ids';
1038:
1031:
1032: Elsif p_parent_entity_name = 'HZ_PARTIES' Then
1033:
1034: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
1035: arp_message.set_token('TABLE_NAME', 'CSI_T_TXN_SYSTEMS', FALSE);
1036:
1037: l_column_name := 'contact_ids';
1038:
1039: open c2;
1054: or service_admin_contact_id = p_from_fk_id;
1055:
1056: l_count := sql%rowcount;
1057:
1058: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
1059: arp_message.set_token('NUM_ROWS', to_char(l_count) );
1060:
1061: End If;
1062:
1055:
1056: l_count := sql%rowcount;
1057:
1058: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
1059: arp_message.set_token('NUM_ROWS', to_char(l_count) );
1060:
1061: End If;
1062:
1063: EXCEPTION
1061: End If;
1062:
1063: EXCEPTION
1064: when internal_party_error then
1065: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' ||v_internal_party_message);
1066: x_return_status := FND_API.G_RET_STS_ERROR;
1067: raise;
1068: when resource_busy then
1069: 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 );
1065: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' ||v_internal_party_message);
1066: x_return_status := FND_API.G_RET_STS_ERROR;
1067: raise;
1068: when resource_busy then
1069: 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 );
1070: x_return_status := FND_API.G_RET_STS_ERROR;
1071: raise;
1072: when others then
1073: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || sqlerrm);
1069: 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 );
1070: x_return_status := FND_API.G_RET_STS_ERROR;
1071: raise;
1072: when others then
1073: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || sqlerrm);
1074: x_return_status := FND_API.G_RET_STS_ERROR;
1075: raise;
1076: END;
1077:
1112:
1113: RESOURCE_BUSY EXCEPTION;
1114: PRAGMA EXCEPTION_INIT(RESOURCE_BUSY, -0054);
1115: BEGIN
1116: arp_message.set_line('CSI_PARTY_MERGE_PKG.CSI_T_PARTY_DETAILS_MERGE()+');
1117:
1118: x_return_status := FND_API.G_RET_STS_SUCCESS;
1119:
1120: begin
1125: when no_data_found then
1126: 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';
1127: raise internal_party_error;
1128: when others then
1129: arp_message.set_line(g_proc_name || '.' ||l_api_name || ': ' ||sqlerrm);
1130: x_return_status := FND_API.G_RET_STS_ERROR;
1131: raise;
1132: end;
1133:
1160: IF p_from_fk_id <> p_to_fk_id then
1161:
1162: BEGIN
1163:
1164: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
1165: arp_message.set_token('TABLE_NAME', 'CSI_T_PARTY_DETAILS', FALSE);
1166: l_column_name := 'party_source_id';
1167:
1168: open c1;
1161:
1162: BEGIN
1163:
1164: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
1165: arp_message.set_token('TABLE_NAME', 'CSI_T_PARTY_DETAILS', FALSE);
1166: l_column_name := 'party_source_id';
1167:
1168: open c1;
1169: close c1;
1177: and party_source_table = v_party_source_table;
1178:
1179: l_count := sql%rowcount;
1180:
1181: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
1182: arp_message.set_token('NUM_ROWS', to_char(l_count) );
1183:
1184: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
1185: arp_message.set_token('TABLE_NAME', 'CSI_T_PARTY_DETAILS', FALSE);
1178:
1179: l_count := sql%rowcount;
1180:
1181: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
1182: arp_message.set_token('NUM_ROWS', to_char(l_count) );
1183:
1184: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
1185: arp_message.set_token('TABLE_NAME', 'CSI_T_PARTY_DETAILS', FALSE);
1186:
1180:
1181: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
1182: arp_message.set_token('NUM_ROWS', to_char(l_count) );
1183:
1184: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
1185: arp_message.set_token('TABLE_NAME', 'CSI_T_PARTY_DETAILS', FALSE);
1186:
1187: l_column_name := 'contact_party_id';
1188:
1181: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
1182: arp_message.set_token('NUM_ROWS', to_char(l_count) );
1183:
1184: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
1185: arp_message.set_token('TABLE_NAME', 'CSI_T_PARTY_DETAILS', FALSE);
1186:
1187: l_column_name := 'contact_party_id';
1188:
1189: EXCEPTION
1187: l_column_name := 'contact_party_id';
1188:
1189: EXCEPTION
1190: when internal_party_error then
1191: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' ||v_internal_party_message);
1192: x_return_status := FND_API.G_RET_STS_ERROR;
1193: raise;
1194: when resource_busy then
1195: 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 );
1191: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' ||v_internal_party_message);
1192: x_return_status := FND_API.G_RET_STS_ERROR;
1193: raise;
1194: when resource_busy then
1195: 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 );
1196: x_return_status := FND_API.G_RET_STS_ERROR;
1197: raise;
1198: when others then
1199: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || sqlerrm);
1195: 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 );
1196: x_return_status := FND_API.G_RET_STS_ERROR;
1197: raise;
1198: when others then
1199: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || sqlerrm);
1200: x_return_status := FND_API.G_RET_STS_ERROR;
1201: raise;
1202: END;
1203: END IF;
1239:
1240: RESOURCE_BUSY EXCEPTION;
1241: PRAGMA EXCEPTION_INIT(RESOURCE_BUSY, -0054);
1242: BEGIN
1243: arp_message.set_line('CSI_PARTY_MERGE_PKG.CSI_T_TXN_LINE_DETAILS_MERGE()+');
1244:
1245: x_return_status := FND_API.G_RET_STS_SUCCESS;
1246:
1247: select merge_reason_code
1264: end if;
1265:
1266: IF p_from_fk_id <> p_to_fk_id then
1267: BEGIN
1268: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
1269: arp_message.set_token('TABLE_NAME', 'CSI_T_TXN_LINE_DETAILS', FALSE);
1270: l_column_name := 'location_id';
1271:
1272: open c1;
1265:
1266: IF p_from_fk_id <> p_to_fk_id then
1267: BEGIN
1268: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
1269: arp_message.set_token('TABLE_NAME', 'CSI_T_TXN_LINE_DETAILS', FALSE);
1270: l_column_name := 'location_id';
1271:
1272: open c1;
1273: close c1;
1282: or ( install_location_id = p_from_fk_id and install_location_type_code = v_location_type_code );
1283:
1284: l_count := sql%rowcount;
1285:
1286: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
1287: arp_message.set_token('NUM_ROWS', to_char(l_count) );
1288:
1289: EXCEPTION
1290: when internal_party_error then
1283:
1284: l_count := sql%rowcount;
1285:
1286: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
1287: arp_message.set_token('NUM_ROWS', to_char(l_count) );
1288:
1289: EXCEPTION
1290: when internal_party_error then
1291: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || v_internal_party_message);
1287: arp_message.set_token('NUM_ROWS', to_char(l_count) );
1288:
1289: EXCEPTION
1290: when internal_party_error then
1291: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || v_internal_party_message);
1292: x_return_status := FND_API.G_RET_STS_ERROR;
1293: raise;
1294: when resource_busy then
1295: 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 );
1291: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || v_internal_party_message);
1292: x_return_status := FND_API.G_RET_STS_ERROR;
1293: raise;
1294: when resource_busy then
1295: 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 );
1296: x_return_status := FND_API.G_RET_STS_ERROR;
1297: raise;
1298: when others then
1299: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || sqlerrm);
1295: 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 );
1296: x_return_status := FND_API.G_RET_STS_ERROR;
1297: raise;
1298: when others then
1299: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || sqlerrm);
1300: x_return_status := FND_API.G_RET_STS_ERROR;
1301: raise;
1302: END;
1303: END IF;