83: AND parallel_worker_id is NULL
84: AND source_system_name = nvl(p_source_system_name,source_system_name);
85:
86: IF(l_debug_level>1) THEN
87: FND_File.Put_Line(Fnd_File.LOG,'Number of Loops: '||to_char(x_count));
88: end if;
89:
90: FOR l_count in 1 .. x_count LOOP
91:
208: l_tbl_count := 0;
209: l_tbl_count := l_instance_tbl.count;
210: l_ext_tbl_count := l_ext_attrib_tbl.count;
211: IF(l_debug_level>1) THEN
212: FND_File.Put_Line(Fnd_File.LOG,'Updating Status of Inst Children '||
213: l_tbl_count);
214: FND_File.Put_Line(Fnd_File.LOG,'Ext Attr Status Recs '||l_ext_tbl_count);
215: FND_File.Put_Line(Fnd_File.LOG,'Before Loop to set Child Status: '||
216: to_char(sysdate,'DD-MON-YYYY HH:MI:SS:SS'));
210: l_ext_tbl_count := l_ext_attrib_tbl.count;
211: IF(l_debug_level>1) THEN
212: FND_File.Put_Line(Fnd_File.LOG,'Updating Status of Inst Children '||
213: l_tbl_count);
214: FND_File.Put_Line(Fnd_File.LOG,'Ext Attr Status Recs '||l_ext_tbl_count);
215: FND_File.Put_Line(Fnd_File.LOG,'Before Loop to set Child Status: '||
216: to_char(sysdate,'DD-MON-YYYY HH:MI:SS:SS'));
217: END IF;
218:
211: IF(l_debug_level>1) THEN
212: FND_File.Put_Line(Fnd_File.LOG,'Updating Status of Inst Children '||
213: l_tbl_count);
214: FND_File.Put_Line(Fnd_File.LOG,'Ext Attr Status Recs '||l_ext_tbl_count);
215: FND_File.Put_Line(Fnd_File.LOG,'Before Loop to set Child Status: '||
216: to_char(sysdate,'DD-MON-YYYY HH:MI:SS:SS'));
217: END IF;
218:
219: j := 1;
217: END IF;
218:
219: j := 1;
220: IF(l_debug_level>1) THEN
221: FND_File.Put_Line(Fnd_File.LOG,'After Loop to set Child Status: '||
222: to_char(sysdate,'DD-MON-YYYY HH:MI:SS:SS'));
223: END IF;
224: COMMIT;
225: END LOOP; -- End of For Loop
230: l_return_status,
231: l_error_message);
232:
233: IF(l_debug_level>1) THEN
234: FND_File.Put_Line(Fnd_File.LOG,'After Log Errors: '||
235: to_char(sysdate,'DD-MON-YYYY HH:MI:SS:SS'));
236: END IF;
237:
238: COMMIT;
239:
240: EXCEPTION
241: WHEN RESOLVE_ERROR THEN
242: IF(l_debug_level>1) THEN
243: FND_File.Put_Line(Fnd_File.LOG,'Resolve IDs Errored out...');
244: FND_File.Put_Line(Fnd_File.LOG,l_error_message);
245: END IF;
246: x_return_status := l_fnd_error;
247: x_msg_data := l_error_message;
240: EXCEPTION
241: WHEN RESOLVE_ERROR THEN
242: IF(l_debug_level>1) THEN
243: FND_File.Put_Line(Fnd_File.LOG,'Resolve IDs Errored out...');
244: FND_File.Put_Line(Fnd_File.LOG,l_error_message);
245: END IF;
246: x_return_status := l_fnd_error;
247: x_msg_data := l_error_message;
248: WHEN fnd_api.g_exc_error THEN
247: x_msg_data := l_error_message;
248: WHEN fnd_api.g_exc_error THEN
249: ROLLBACK to create_instances;
250: IF(l_debug_level>1) THEN
251: FND_File.Put_Line(Fnd_File.LOG,'In EXPECTED Exception in:'||l_api_name);
252: FND_File.Put_Line(Fnd_File.LOG,l_error_message);
253: END IF;
254: x_return_status := l_fnd_error;
255: x_msg_data := l_error_message;
248: WHEN fnd_api.g_exc_error THEN
249: ROLLBACK to create_instances;
250: IF(l_debug_level>1) THEN
251: FND_File.Put_Line(Fnd_File.LOG,'In EXPECTED Exception in:'||l_api_name);
252: FND_File.Put_Line(Fnd_File.LOG,l_error_message);
253: END IF;
254: x_return_status := l_fnd_error;
255: x_msg_data := l_error_message;
256:
256:
257: WHEN others THEN
258: ROLLBACK to create_instances;
259: IF(l_debug_level>1) THEN
260: FND_File.Put_Line(Fnd_File.LOG,'In WHEN OTHERS Exception in:'||l_api_name);
261: END IF;
262: l_sql_error := SQLERRM;
263: fnd_message.set_name('CSI','CSI_ML_UNEXP_SQL_ERROR');
264: fnd_message.set_token('API_NAME',l_api_name);
263: fnd_message.set_name('CSI','CSI_ML_UNEXP_SQL_ERROR');
264: fnd_message.set_token('API_NAME',l_api_name);
265: fnd_message.set_token('SQL_ERROR',SQLERRM);
266: x_msg_data := fnd_message.get;
267: FND_File.Put_Line(Fnd_File.LOG,x_msg_data);
268: x_return_status := l_fnd_unexpected;
269:
270: END create_instances;
271:
334:
335: BEGIN
336:
337: IF(l_debug_level>1) THEN
338: FND_File.Put_Line(Fnd_File.LOG,'Start Time of Pub: '||
339: to_char(sysdate,'DD-MON-YYYY HH:MI:SS:SS'));
340: END IF;
341: x_return_status := l_fnd_success;
342:
346: SELECT nvl(FND_PROFILE.VALUE('CSI_OPEN_INTERFACE_COMMIT_RECS'),1000)
347: INTO l_commit_recs
348: FROM dual;
349:
350: FND_File.Put_Line(Fnd_File.LOG,'After Commit Profile: '||
351: to_char(sysdate,'DD-MON-YYYY HH:MI:SS:SS'));
352:
353: l_txn_from_date := to_date(p_txn_from_date, 'YYYY/MM/DD HH24:MI:SS');
354: l_txn_to_date := to_date(p_txn_to_date, 'YYYY/MM/DD HH24:MI:SS');
365: AND source_system_name = nvl(p_source_system_name,source_system_name)
366: AND parallel_worker_id = p_worker_id;
367:
368: IF(l_debug_level>1) THEN
369: FND_File.Put_Line(Fnd_File.LOG,'After Fiqure out Loops: '||
370: to_char(sysdate,'DD-MON-YYYY HH:MI:SS:SS'));
371: FND_File.Put_Line(Fnd_File.LOG,'Number of Loops: '||to_char(x_count));
372: END IF;
373:
367:
368: IF(l_debug_level>1) THEN
369: FND_File.Put_Line(Fnd_File.LOG,'After Fiqure out Loops: '||
370: to_char(sysdate,'DD-MON-YYYY HH:MI:SS:SS'));
371: FND_File.Put_Line(Fnd_File.LOG,'Number of Loops: '||to_char(x_count));
372: END IF;
373:
374: FOR l_count in 1 .. x_count LOOP
375: -- Update the tables to have 'X' in the process status field.
393: AND rownum <= l_commit_recs;
394:
395: IF(l_debug_level>1) THEN
396:
397: FND_File.Put_Line(Fnd_File.LOG,'After setting INST IFACE to X: '||
398: to_char(sysdate,'DD-MON-YYYY HH:MI:SS:SS'));
399: END IF;
400:
401: l_inst_id_tbl.delete;
407:
408: COMMIT;
409:
410: IF(l_debug_level>1) THEN
411: FND_File.Put_Line(Fnd_File.LOG,'After ID PL/SQL Table Create: '||
412: to_char(sysdate,'DD-MON-YYYY HH:MI:SS:SS'));
413: END IF;
414:
415: l_tbl_count := 0;
414:
415: l_tbl_count := 0;
416: l_tbl_count := l_inst_id_tbl.count;
417: IF(l_debug_level>1) THEN
418: FND_File.Put_Line(Fnd_File.LOG,'Records Found: '||l_tbl_count);
419: FND_File.Put_Line(Fnd_File.LOG,'After Looping Child Tables: '||
420: to_char(sysdate,'DD-MON-YYYY HH:MI:SS:SS'));
421:
422: -- Resolve all ID fields from Descriptive Fields
415: l_tbl_count := 0;
416: l_tbl_count := l_inst_id_tbl.count;
417: IF(l_debug_level>1) THEN
418: FND_File.Put_Line(Fnd_File.LOG,'Records Found: '||l_tbl_count);
419: FND_File.Put_Line(Fnd_File.LOG,'After Looping Child Tables: '||
420: to_char(sysdate,'DD-MON-YYYY HH:MI:SS:SS'));
421:
422: -- Resolve all ID fields from Descriptive Fields
423: FND_File.Put_Line(Fnd_File.LOG,'Before Resolve IDs: '||
419: FND_File.Put_Line(Fnd_File.LOG,'After Looping Child Tables: '||
420: to_char(sysdate,'DD-MON-YYYY HH:MI:SS:SS'));
421:
422: -- Resolve all ID fields from Descriptive Fields
423: FND_File.Put_Line(Fnd_File.LOG,'Before Resolve IDs: '||
424: to_char(sysdate,'DD-MON-YYYY HH:MI:SS:SS'));
425: END IF;
426: IF l_tbl_count>0 -- Added
427: THEN
432: p_worker_id,
433: l_return_status,
434: l_error_message);
435: IF(l_debug_level>1) THEN
436: FND_File.Put_Line(Fnd_File.LOG,'After Resolve IDs: '||
437: to_char(sysdate,'DD-MON-YYYY HH:MI:SS:SS'));
438: END IF;
439:
440: IF NOT l_return_status = l_fnd_success THEN
443: END IF;
444:
445: -- After getting IDs now create PL/SQL Tables
446: IF(l_debug_level>1) THEN
447: FND_File.Put_Line(Fnd_File.LOG,'Before PL/SQL Table Create: '||
448: to_char(sysdate,'DD-MON-YYYY HH:MI:SS:SS'));
449: END IF;
450:
451: SAVEPOINT create_parallel_instances;
466: l_asset_assignment_tbl,
467: l_return_status,
468: l_error_message);
469: IF(l_debug_level>1) THEN
470: FND_File.Put_Line(Fnd_File.LOG,'After PL/SQL Table Create: '||
471: to_char(sysdate,'DD-MON-YYYY HH:MI:SS:SS'));
472: END IF;
473:
474: IF NOT l_return_status = l_fnd_success THEN
475: RAISE fnd_api.g_exc_error;
476: END IF;
477:
478: IF(l_debug_level>1) THEN
479: FND_File.Put_Line(Fnd_File.LOG,'Before Contact Loop: '||
480: to_char(sysdate,'DD-MON-YYYY HH:MI:SS:SS'));
481:
482: -- commented the following unnecessary code
483: /*
495: END LOOP;
496: END LOOP;
497: END IF;
498: */
499: FND_File.Put_Line(Fnd_File.LOG,'After Contact Loop: '||
500: to_char(sysdate,'DD-MON-YYYY HH:MI:SS:SS'));
501:
502: FND_File.Put_Line(Fnd_File.LOG,'Before GRP API: '||
503: to_char(sysdate,'DD-MON-YYYY HH:MI:SS:SS'));
498: */
499: FND_File.Put_Line(Fnd_File.LOG,'After Contact Loop: '||
500: to_char(sysdate,'DD-MON-YYYY HH:MI:SS:SS'));
501:
502: FND_File.Put_Line(Fnd_File.LOG,'Before GRP API: '||
503: to_char(sysdate,'DD-MON-YYYY HH:MI:SS:SS'));
504: END IF;
505: csi_item_instance_grp.create_item_instance
506: (p_api_version => l_api_version,
533: END LOOP;
534: RAISE fnd_api.g_exc_error;
535: END IF;
536: IF(l_debug_level>1) THEN
537: FND_File.Put_Line(Fnd_File.LOG,'After GRP API: '||
538: to_char(sysdate,'DD-MON-YYYY HH:MI:SS:SS'));
539: END IF;
540: l_tbl_count := 0;
541: l_tbl_count := l_instance_tbl.count;
540: l_tbl_count := 0;
541: l_tbl_count := l_instance_tbl.count;
542: l_ext_tbl_count := l_ext_attrib_tbl.count;
543: IF(l_debug_level>1) THEN
544: FND_File.Put_Line(Fnd_File.LOG,'Updating Status of Inst Children '||
545: l_tbl_count);
546: FND_File.Put_Line(Fnd_File.LOG,'Ext Attr Status Recs '||l_ext_tbl_count);
547: FND_File.Put_Line(Fnd_File.LOG,'Before Loop to set Child Status: '||
548: to_char(sysdate,'DD-MON-YYYY HH:MI:SS:SS'));
542: l_ext_tbl_count := l_ext_attrib_tbl.count;
543: IF(l_debug_level>1) THEN
544: FND_File.Put_Line(Fnd_File.LOG,'Updating Status of Inst Children '||
545: l_tbl_count);
546: FND_File.Put_Line(Fnd_File.LOG,'Ext Attr Status Recs '||l_ext_tbl_count);
547: FND_File.Put_Line(Fnd_File.LOG,'Before Loop to set Child Status: '||
548: to_char(sysdate,'DD-MON-YYYY HH:MI:SS:SS'));
549:
550: FND_File.Put_Line(Fnd_File.LOG,'After Loop to set Child Status: '||
543: IF(l_debug_level>1) THEN
544: FND_File.Put_Line(Fnd_File.LOG,'Updating Status of Inst Children '||
545: l_tbl_count);
546: FND_File.Put_Line(Fnd_File.LOG,'Ext Attr Status Recs '||l_ext_tbl_count);
547: FND_File.Put_Line(Fnd_File.LOG,'Before Loop to set Child Status: '||
548: to_char(sysdate,'DD-MON-YYYY HH:MI:SS:SS'));
549:
550: FND_File.Put_Line(Fnd_File.LOG,'After Loop to set Child Status: '||
551: to_char(sysdate,'DD-MON-YYYY HH:MI:SS:SS'));
546: FND_File.Put_Line(Fnd_File.LOG,'Ext Attr Status Recs '||l_ext_tbl_count);
547: FND_File.Put_Line(Fnd_File.LOG,'Before Loop to set Child Status: '||
548: to_char(sysdate,'DD-MON-YYYY HH:MI:SS:SS'));
549:
550: FND_File.Put_Line(Fnd_File.LOG,'After Loop to set Child Status: '||
551: to_char(sysdate,'DD-MON-YYYY HH:MI:SS:SS'));
552: END IF;
553: END IF; -- End addition
554: COMMIT;
561: l_return_status,
562: l_error_message);
563:
564: IF(l_debug_level>1) THEN
565: FND_File.Put_Line(Fnd_File.LOG,'After Log Errors: '||
566: to_char(sysdate,'DD-MON-YYYY HH:MI:SS:SS'));
567: END IF;
568: COMMIT;
569:
569:
570: EXCEPTION
571: WHEN RESOLVE_ERROR THEN
572: IF(l_debug_level>1) THEN
573: FND_File.Put_Line(Fnd_File.LOG,'Resolve Parallel IDs Errored out...');
574: END IF;
575: j := 1;
576: FOR j in l_inst_id_tbl.FIRST .. l_inst_id_tbl.LAST LOOP
577:
584: WHEN fnd_api.g_exc_error THEN
585: ROLLBACK to create_parallel_instances;
586:
587: IF(l_debug_level>1) THEN
588: FND_File.Put_Line(Fnd_File.LOG,'In EXPECTED Exception in:'||l_api_name);
589: END IF;
590: j := 1;
591: FOR j in l_inst_id_tbl.FIRST .. l_inst_id_tbl.LAST LOOP
592:
596:
597: END LOOP;
598: COMMIT;
599:
600: FND_File.Put_Line(Fnd_File.LOG,l_error_message);
601: x_return_status := l_fnd_error;
602: x_msg_data := l_error_message;
603:
604: WHEN others THEN
603:
604: WHEN others THEN
605: ROLLBACK to create_parallel_instances;
606:
607: FND_File.Put_Line(Fnd_File.LOG,'In WHEN OTHERS Exception in:'||l_api_name);
608:
609: j := 1;
610: FOR j in l_inst_id_tbl.FIRST .. l_inst_id_tbl.LAST LOOP
611:
620: fnd_message.set_name('CSI','CSI_ML_UNEXP_SQL_ERROR');
621: fnd_message.set_token('API_NAME',l_api_name);
622: fnd_message.set_token('SQL_ERROR',SQLERRM);
623: x_msg_data := fnd_message.get;
624: FND_File.Put_Line(Fnd_File.LOG,substr(x_msg_data,1,200));
625: x_return_status := l_fnd_unexpected;
626:
627: END create_parallel_instances;
628:
660:
661: BEGIN
662:
663: IF(l_debug_level>1) THEN
664: FND_File.Put_Line(Fnd_File.LOG,'Start of: '||l_api_name);
665: END IF;
666:
667: x_return_status := l_fnd_success;
668:
670: WHEN fnd_api.g_exc_error THEN
671: ROLLBACK to create_relationships;
672:
673: IF(l_debug_level>1) THEN
674: FND_File.Put_Line(Fnd_File.LOG,'In EXPECTED Exception in:'||l_api_name);
675: FND_File.Put_Line(Fnd_File.LOG,l_error_message);
676: END IF;
677: x_return_status := l_fnd_error;
678: x_msg_data := l_error_message;
671: ROLLBACK to create_relationships;
672:
673: IF(l_debug_level>1) THEN
674: FND_File.Put_Line(Fnd_File.LOG,'In EXPECTED Exception in:'||l_api_name);
675: FND_File.Put_Line(Fnd_File.LOG,l_error_message);
676: END IF;
677: x_return_status := l_fnd_error;
678: x_msg_data := l_error_message;
679:
679:
680: WHEN others THEN
681: ROLLBACK to create_relationships;
682: IF(l_debug_level>1) THEN
683: FND_File.Put_Line(Fnd_File.LOG,'In WHEN OTHERS Exception in:'||l_api_name);
684: END IF;
685: l_sql_error := SQLERRM;
686: fnd_message.set_name('CSI','CSI_ML_UNEXP_SQL_ERROR');
687: fnd_message.set_token('API_NAME',l_api_name);
687: fnd_message.set_token('API_NAME',l_api_name);
688: fnd_message.set_token('SQL_ERROR',SQLERRM);
689: x_msg_data := fnd_message.get;
690: IF(l_debug_level>1) THEN
691: FND_File.Put_Line(Fnd_File.LOG,x_msg_data);
692: END IF;
693: x_return_status := l_fnd_unexpected;
694:
695: END create_relationships;