70: PRAGMA EXCEPTION_INIT(RESOURCE_BUSY, -0054);
71:
72: BEGIN
73:
74: arp_message.set_line('CS_CH_PARTY_MERGE_PKG.CS_CH_ALL_MERGE_SITE_ID()+');
75:
76: x_return_status := FND_API.G_RET_STS_SUCCESS;
77:
78: select merge_reason_code
104:
105: if p_from_fk_id <> p_to_fk_id then
106: begin
107: -- obtain lock on records to be updated.
108: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
109: arp_message.set_token('TABLE_NAME', 'CS_ESTIMATE_DETAILS', FALSE);
110:
111: open c1;
112: fetch c1 bulk collect into l_rowid_tbl;
105: if p_from_fk_id <> p_to_fk_id then
106: begin
107: -- obtain lock on records to be updated.
108: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
109: arp_message.set_token('TABLE_NAME', 'CS_ESTIMATE_DETAILS', FALSE);
110:
111: open c1;
112: fetch c1 bulk collect into l_rowid_tbl;
113: close c1;
130: where rowid = l_rowid_tbl(i);
131:
132: l_count := sql%rowcount;
133:
134: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
135: arp_message.set_token('NUM_ROWS', to_char(l_count) );
136:
137: exception
138: when resource_busy then
131:
132: l_count := sql%rowcount;
133:
134: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
135: arp_message.set_token('NUM_ROWS', to_char(l_count) );
136:
137: exception
138: when resource_busy then
139: arp_message.set_line(g_proc_name || '.' || l_api_name || '; Could not obtain lock for records in table ' ||
135: arp_message.set_token('NUM_ROWS', to_char(l_count) );
136:
137: exception
138: when resource_busy then
139: arp_message.set_line(g_proc_name || '.' || l_api_name || '; Could not obtain lock for records in table ' ||
140: 'CS_ESTIMATE_DETAILS for bill_to_party_id / ship_to_party_id ' ||
141: 'bill_to_contact_id / ship_to_contact_id = ' || p_from_fk_id );
142: x_return_status := FND_API.G_RET_STS_ERROR;
143: raise;
142: x_return_status := FND_API.G_RET_STS_ERROR;
143: raise;
144:
145: when others then
146: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || sqlerrm);
147: x_return_status := FND_API.G_RET_STS_ERROR;
148: raise;
149: end;
150:
188: RESOURCE_BUSY EXCEPTION;
189: PRAGMA EXCEPTION_INIT(RESOURCE_BUSY, -0054);
190:
191: BEGIN
192: arp_message.set_line('CS_CH_PARTY_MERGE_PKG.CS_CH_ALL_MERGE_SITE_ID()+');
193:
194: x_return_status := FND_API.G_RET_STS_SUCCESS;
195:
196: select merge_reason_code
230:
231: if p_from_fk_id <> p_to_fk_id then
232: begin
233: -- obtain lock on records to be updated.
234: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
235: arp_message.set_token('TABLE_NAME', 'CS_ESTIMATE_DETAILS', FALSE);
236:
237: open c1;
238: fetch c1 bulk collect into l_rowid_tbl;
231: if p_from_fk_id <> p_to_fk_id then
232: begin
233: -- obtain lock on records to be updated.
234: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
235: arp_message.set_token('TABLE_NAME', 'CS_ESTIMATE_DETAILS', FALSE);
236:
237: open c1;
238: fetch c1 bulk collect into l_rowid_tbl;
239: close c1;
272:
273:
274: l_count := sql%rowcount;
275:
276: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
277: arp_message.set_token('NUM_ROWS', to_char(l_count) );
278:
279: exception
280: when resource_busy then
273:
274: l_count := sql%rowcount;
275:
276: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
277: arp_message.set_token('NUM_ROWS', to_char(l_count) );
278:
279: exception
280: when resource_busy then
281: arp_message.set_line(g_proc_name || '.' || l_api_name ||
277: arp_message.set_token('NUM_ROWS', to_char(l_count) );
278:
279: exception
280: when resource_busy then
281: arp_message.set_line(g_proc_name || '.' || l_api_name ||
282: '; Could not obtain lock for records in table ' ||
283: 'CS_ESTIMATE_DETAILS for invoice_to_org_id/ship_to_org_id = ' || p_from_fk_id );
284: x_return_status := FND_API.G_RET_STS_ERROR;
285: raise;
284: x_return_status := FND_API.G_RET_STS_ERROR;
285: raise;
286:
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;
338: RESOURCE_BUSY EXCEPTION;
339: PRAGMA EXCEPTION_INIT(RESOURCE_BUSY, -0054);
340:
341: BEGIN
342: arp_message.set_line('CS_CH_PARTY_MERGE_PKG.CS_CHG_ALL_SETUP_PARTY()+');
343:
344: x_return_status := FND_API.G_RET_STS_SUCCESS;
345:
346:
363:
364: if p_from_fk_id <> p_to_fk_id then
365: begin
366: -- obtain lock on records to be updated.
367: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
368: arp_message.set_token('TABLE_NAME', 'CS_CHG_SUB_RESTRICTIONS', FALSE);
369:
370: open c1;
371: fetch c1 bulk collect into l_rowid_tbl;
364: if p_from_fk_id <> p_to_fk_id then
365: begin
366: -- obtain lock on records to be updated.
367: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
368: arp_message.set_token('TABLE_NAME', 'CS_CHG_SUB_RESTRICTIONS', FALSE);
369:
370: open c1;
371: fetch c1 bulk collect into l_rowid_tbl;
372: close c1;
401: where rowid = l_rowid_tbl(i);
402:
403: l_count := sql%rowcount;
404:
405: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
406: arp_message.set_token('NUM_ROWS', to_char(l_count) );
407:
408: --go back and end date the active restriction which had p_from_fk_id merged to
409: --p_to_fk_id since there can only be one active restriction at any one point
402:
403: l_count := sql%rowcount;
404:
405: arp_message.set_name('AR', 'AR_ROWS_UPDATED');
406: arp_message.set_token('NUM_ROWS', to_char(l_count) );
407:
408: --go back and end date the active restriction which had p_from_fk_id merged to
409: --p_to_fk_id since there can only be one active restriction at any one point
410: --Fix for Bug # 3599517
420:
421:
422: exception
423: when resource_busy then
424: arp_message.set_line(g_proc_name || '.' || l_api_name || '; Could not obtain lock for records in table ' || 'CS_CHG_SUB_RESTRICTIONS for value_object_id' || 'bill_to_contact_id / ship_to_contact_id = ' || p_from_fk_id );
425: x_return_status := FND_API.G_RET_STS_ERROR;
426: raise;
427:
428: when others then
425: x_return_status := FND_API.G_RET_STS_ERROR;
426: raise;
427:
428: when others then
429: arp_message.set_line(g_proc_name || '.' || l_api_name || ': ' || sqlerrm);
430: x_return_status := FND_API.G_RET_STS_ERROR;
431: raise;
432: end;
433: