138:
139: p_errnum := 0;
140: p_errmesg :='';
141:
142: -- LOCK TABLE wip_bis_perf_to_plan IN EXCLUSIVE MODE NOWAIT;
143:
144: insert into wip_bis_perf_to_plan(
145: ORGANIZATION_ID,
146: INVENTORY_ITEM_ID,
140: p_errmesg :='';
141:
142: -- LOCK TABLE wip_bis_perf_to_plan IN EXCLUSIVE MODE NOWAIT;
143:
144: insert into wip_bis_perf_to_plan(
145: ORGANIZATION_ID,
146: INVENTORY_ITEM_ID,
147: SCHEDULE_DATE,
148: SCHEDULE_QUANTITY,
203: inventory_item_id,
204: schedule_date,
205: actual_quantity,
206: item_cost
207: FROM wip_bis_perf_to_plan WHERE existing_flag = 0 FOR UPDATE;
208: perf_rec perf_cur%ROWTYPE;
209:
210: BEGIN
211: p_errnum := 0;
416: END;
417:
418: sum_quantity := sum_quantity + complete_quantity;
419:
420: UPDATE wip_bis_perf_to_plan
421: SET
422: actual_quantity = actual_quantity + sum_quantity,
423: item_cost = p_item_cost
424: WHERE CURRENT OF perf_cur;
455:
456: p_errnum := 0;
457: p_errmesg :='';
458:
459: -- LOCK TABLE wip_bis_perf_to_plan IN EXCLUSIVE MODE ; -- NOWAIT;
460: --dbms_output.put_line('Delete all the old information from performance table.');
461: delete from wip_bis_perf_to_plan where existing_flag <> 0;
462:
463: --dbms_output.put_line('Commit all the populated data');
457: p_errmesg :='';
458:
459: -- LOCK TABLE wip_bis_perf_to_plan IN EXCLUSIVE MODE ; -- NOWAIT;
460: --dbms_output.put_line('Delete all the old information from performance table.');
461: delete from wip_bis_perf_to_plan where existing_flag <> 0;
462:
463: --dbms_output.put_line('Commit all the populated data');
464: update wip_bis_perf_to_plan set existing_flag = 1;
465:
460: --dbms_output.put_line('Delete all the old information from performance table.');
461: delete from wip_bis_perf_to_plan where existing_flag <> 0;
462:
463: --dbms_output.put_line('Commit all the populated data');
464: update wip_bis_perf_to_plan set existing_flag = 1;
465:
466: --dbms_output.put_line('all the populated data commited successfully.');
467:
468: commit;
474: --dbms_output.put_line(SQLCODE);
475: --dbms_output.put_line(SQLERRM);
476: p_errmesg := 'Failed in post updating performance table: ' ||substr(SQLERRM, 1, 150);
477: p_errnum := SQLCODE;
478: delete from wip_bis_perf_to_plan;
479: --dbms_output.put_line('All data deleted from wip_bis_perf_to_plan');
480: commit;
481: return;
482:
475: --dbms_output.put_line(SQLERRM);
476: p_errmesg := 'Failed in post updating performance table: ' ||substr(SQLERRM, 1, 150);
477: p_errnum := SQLCODE;
478: delete from wip_bis_perf_to_plan;
479: --dbms_output.put_line('All data deleted from wip_bis_perf_to_plan');
480: commit;
481: return;
482:
483: --null;
488: IS
489: BEGIN
490:
491:
492: -- LOCK TABLE wip_bis_perf_to_plan IN EXCLUSIVE MODE NOWAIT;
493:
494: -- Delete all the performance data not correctly populated
495: delete from wip_bis_perf_to_plan
496: where existing_flag = 0;
491:
492: -- LOCK TABLE wip_bis_perf_to_plan IN EXCLUSIVE MODE NOWAIT;
493:
494: -- Delete all the performance data not correctly populated
495: delete from wip_bis_perf_to_plan
496: where existing_flag = 0;
497:
498: commit;
499: return;
503: --dbms_output.put_line('Failed in cleaning up exception.');
504: --dbms_output.put_line(SQLCODE);
505: --dbms_output.put_line(SQLERRM);
506:
507: delete from wip_bis_perf_to_plan;
508: --dbms_output.put_line('All data deleted from wip_bis_perf_to_plan');
509: commit;
510: return;
511:
504: --dbms_output.put_line(SQLCODE);
505: --dbms_output.put_line(SQLERRM);
506:
507: delete from wip_bis_perf_to_plan;
508: --dbms_output.put_line('All data deleted from wip_bis_perf_to_plan');
509: commit;
510: return;
511:
512: END Clean_Up_Exception;