DBA Data[Home] [Help]

APPS.PA_PURGE_PUB dependencies on PA_FORECAST_ITEM_DETAILS

Line 433: -- This API purges unused forecast item data from the 3 tables pa_forecast_items ,pa_forecast_item_details

429: --
430: -- PROCEDURE
431: -- PURGE_FORECAST_ITEMS
432: -- PURPOSE
433: -- This API purges unused forecast item data from the 3 tables pa_forecast_items ,pa_forecast_item_details
434: -- and pa_fi_amount_details
435: --
436: -- Parameter Name In/Out Data Type Null? Default Value Description
437: -- ------------- ------ ---------- ------ ------------- ---------------------------------

Line 555: DELETE FROM pa_forecast_item_details

551: BEGIN
552: -- If forecast_item_type is 'R' , no need to check for any other flag.
553: -- We can delete all the children and parent records.
554: FORALL i IN l_fi_tbl.FIRST..l_fi_tbl.LAST
555: DELETE FROM pa_forecast_item_details
556: WHERE forecast_item_id = l_fi_tbl(i)
557: AND l_fi_type_tbl(i)='R';
558:
559: l_rows2 := l_rows2 + nvl(sql%rowcount,0); -- 5201806 : Using nvl in %rowcount

Line 566: DELETE FROM pa_forecast_item_details

562:
563: -- IF forecast_item_type is not 'R' and pji_summarized_flag is checked.
564: IF l_check_pji_summarized_flag = 'Y' THEN
565: FORALL i IN l_fi_tbl.FIRST..l_fi_tbl.LAST
566: DELETE FROM pa_forecast_item_details
567: WHERE forecast_item_id = l_fi_tbl(i)
568: AND l_fi_type_tbl(i) <> 'R'
569: AND PJI_SUMMARIZED_FLAG in ('X','E');
570:

Line 579: DELETE FROM pa_forecast_item_details a

575: -- Performance fix 5201806
576: -- Included a direct join between the inner and outer queries
577:
578: FORALL i IN l_fi_tbl.FIRST..l_fi_tbl.LAST
579: DELETE FROM pa_forecast_item_details a
580: WHERE a.forecast_item_id = l_fi_tbl(i)
581: AND l_fi_type_tbl(i) <> 'R'
582: AND ( 'Y' = ALL(SELECT nvl(b.PJI_SUMMARIZED_FLAG,'Y') -- All records are NULL or Y
583: FROM pa_forecast_item_details b

Line 583: FROM pa_forecast_item_details b

579: DELETE FROM pa_forecast_item_details a
580: WHERE a.forecast_item_id = l_fi_tbl(i)
581: AND l_fi_type_tbl(i) <> 'R'
582: AND ( 'Y' = ALL(SELECT nvl(b.PJI_SUMMARIZED_FLAG,'Y') -- All records are NULL or Y
583: FROM pa_forecast_item_details b
584: WHERE b.forecast_item_id = a.forecast_item_id)
585: OR 'N' = ALL (SELECT nvl(c.PJI_SUMMARIZED_FLAG,'XYZ') -- Otherwise,All records should be N
586: FROM pa_forecast_item_details c
587: WHERE c.forecast_item_id = a.forecast_item_id)

Line 586: FROM pa_forecast_item_details c

582: AND ( 'Y' = ALL(SELECT nvl(b.PJI_SUMMARIZED_FLAG,'Y') -- All records are NULL or Y
583: FROM pa_forecast_item_details b
584: WHERE b.forecast_item_id = a.forecast_item_id)
585: OR 'N' = ALL (SELECT nvl(c.PJI_SUMMARIZED_FLAG,'XYZ') -- Otherwise,All records should be N
586: FROM pa_forecast_item_details c
587: WHERE c.forecast_item_id = a.forecast_item_id)
588: ) ;
589:
590: l_rows2 := l_rows2 + nvl(sql%rowcount,0);

Line 600: DELETE FROM pa_forecast_item_details

596: IF l_util_summarized_Code_flag = 'Y' THEN
597:
598: -- delete all child records with UTIL_SUMMARIZED_CODE as 'X' and 'E'
599: FORALL i IN l_fi_tbl.FIRST..l_fi_tbl.LAST
600: DELETE FROM pa_forecast_item_details
601: WHERE forecast_item_id = l_fi_tbl(i)
602: AND l_fi_type_tbl(i) <> 'R'
603: AND UTIL_SUMMARIZED_CODE in ('X','E');
604:

Line 613: DELETE FROM pa_forecast_item_details a

609: -- Performance fix 5201806
610: -- Included a direct join between the inner and outer queries
611:
612: FORALL i IN l_fi_tbl.FIRST..l_fi_tbl.LAST
613: DELETE FROM pa_forecast_item_details a
614: where a.forecast_item_id = l_fi_tbl(i)
615: and l_fi_type_tbl(i) <> 'R'
616: and ( 'Y' = ALL(SELECT nvl(b.UTIL_SUMMARIZED_CODE,'Y')
617: FROM pa_forecast_item_details b

Line 617: FROM pa_forecast_item_details b

613: DELETE FROM pa_forecast_item_details a
614: where a.forecast_item_id = l_fi_tbl(i)
615: and l_fi_type_tbl(i) <> 'R'
616: and ( 'Y' = ALL(SELECT nvl(b.UTIL_SUMMARIZED_CODE,'Y')
617: FROM pa_forecast_item_details b
618: WHERE b.forecast_item_id = a.forecast_item_id)
619: OR 'N' = ALL (SELECT nvl(c.UTIL_SUMMARIZED_CODE,'XYZ')
620: FROM pa_forecast_item_details c
621: WHERE c.forecast_item_id = a.forecast_item_id)

Line 620: FROM pa_forecast_item_details c

616: and ( 'Y' = ALL(SELECT nvl(b.UTIL_SUMMARIZED_CODE,'Y')
617: FROM pa_forecast_item_details b
618: WHERE b.forecast_item_id = a.forecast_item_id)
619: OR 'N' = ALL (SELECT nvl(c.UTIL_SUMMARIZED_CODE,'XYZ')
620: FROM pa_forecast_item_details c
621: WHERE c.forecast_item_id = a.forecast_item_id)
622: ) ;
623:
624: l_rows2 := l_rows2 + nvl(sql%rowcount,0);

Line 649: -- 5201806 : Added l_fi_type_tbl join too. R type records are deleted from pa_forecast_item_details

645:
646: -- FI Amount Details Delete
647: BEGIN
648: -- 5175803 Performance fix: Included a direct join between the inner and outer queries
649: -- 5201806 : Added l_fi_type_tbl join too. R type records are deleted from pa_forecast_item_details
650: -- without any conditions. So no need to check for their exostence.
651: FORALL i IN l_fi_tbl.FIRST..l_fi_tbl.LAST
652: DELETE FROM pa_fi_amount_details fi
653: WHERE fi.forecast_item_id = l_fi_tbl(i)

Line 656: AND NOT EXISTS( SELECT 'Y' from pa_forecast_item_details dtl

652: DELETE FROM pa_fi_amount_details fi
653: WHERE fi.forecast_item_id = l_fi_tbl(i)
654: AND( (l_fi_type_tbl(i) = 'R')
655: OR (l_fi_type_tbl(i) <> 'R'
656: AND NOT EXISTS( SELECT 'Y' from pa_forecast_item_details dtl
657: WHERE dtl.forecast_item_id = fi.forecast_item_id)))
658: ;
659:
660: l_rows3 := l_rows3 + nvl(sql%rowcount,0);

Line 684: -- 5201806 : Added l_fi_type_tbl join too. R type records are deleted from pa_forecast_item_details

680: BEGIN
681:
682: -- 5175803 Performance fix
683: -- Included a direct join between the inner and outer queries
684: -- 5201806 : Added l_fi_type_tbl join too. R type records are deleted from pa_forecast_item_details
685: -- without any conditions. So no need to check for their exostence.
686: FORALL i IN l_fi_tbl.FIRST..l_fi_tbl.LAST
687: DELETE FROM pa_forecast_items fi
688: WHERE fi.forecast_item_id = l_fi_tbl(i)

Line 691: AND NOT EXISTS( SELECT 'Y' from pa_forecast_item_details dtl

687: DELETE FROM pa_forecast_items fi
688: WHERE fi.forecast_item_id = l_fi_tbl(i)
689: AND( (forecast_item_type = 'R')
690: OR (forecast_item_type <> 'R'
691: AND NOT EXISTS( SELECT 'Y' from pa_forecast_item_details dtl
692: WHERE dtl.forecast_item_id = fi.forecast_item_id)))
693: ;
694:
695: l_rows1 := l_rows1 + nvl(sql%rowcount,0);

Line 719: pa_debug.g_err_stage:= 'No. of rows deleted from pa_forecast_item_details - ' || l_rows2;

715:
716: IF p_debug_mode = 'Y' THEN
717: pa_debug.g_err_stage:= 'No. of rows deleted from pa_forecast_items - ' || l_rows1 ;
718: pa_debug.write('PA_PURGE_PUB',pa_debug.g_err_stage,l_debug_level3);
719: pa_debug.g_err_stage:= 'No. of rows deleted from pa_forecast_item_details - ' || l_rows2;
720: pa_debug.write('PA_PURGE_PUB',pa_debug.g_err_stage,l_debug_level3);
721: pa_debug.g_err_stage:= 'No. of rows deleted from pa_fi_amount_details - ' ||l_rows3;
722: pa_debug.write('PA_PURGE_PUB',pa_debug.g_err_stage,l_debug_level3);
723: END IF;

Line 745: p_table_name => 'PA_FORECAST_ITEM_DETAILS',

741:
742: PA_PURGE_PUB.INSERT_PURGE_LOG
743: (
744: p_request_id => p_request_id ,
745: p_table_name => 'PA_FORECAST_ITEM_DETAILS',
746: p_rows_deleted => l_rows2,
747: x_return_status => x_return_status ,
748: x_msg_count => x_msg_count,
749: x_msg_data => x_msg_data