60: l_old_err_stack := x_err_stack;
61:
62: x_err_stack := x_err_stack || ' ->Entering PA_MC_CUSTREVDISTLINES ';
63:
64: pa_debug.debug(x_err_stack);
65:
66: pa_debug.debug( ' ->Before insert into PA_MC_Rev_Distribution_Lines_AR') ;
67: /* Commented out for MRC migration to SLA
68: insert into Pa_MC_Cust_Rdl_ar
62: x_err_stack := x_err_stack || ' ->Entering PA_MC_CUSTREVDISTLINES ';
63:
64: pa_debug.debug(x_err_stack);
65:
66: pa_debug.debug( ' ->Before insert into PA_MC_Rev_Distribution_Lines_AR') ;
67: /* Commented out for MRC migration to SLA
68: insert into Pa_MC_Cust_Rdl_ar
69: (
70: PURGE_BATCH_ID,
131:
132: */
133: p_mcnoofrecordsins := SQL%ROWCOUNT ;
134:
135: pa_debug.debug( ' ->After insert into PA_Revenue_Distribution_Lines_AR') ;
136: x_err_stack := l_old_err_stack ;
137:
138: EXCEPTION
139: WHEN PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error then
139: WHEN PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error then
140: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
141:
142: WHEN OTHERS THEN
143: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_MC_CUSTREVDISTLINES' );
144: pa_debug.debug('Error stage is '||x_err_stage );
145: pa_debug.debug('Error stack is '||x_err_stack );
146: pa_debug.debug(SQLERRM);
147: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
140: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
141:
142: WHEN OTHERS THEN
143: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_MC_CUSTREVDISTLINES' );
144: pa_debug.debug('Error stage is '||x_err_stage );
145: pa_debug.debug('Error stack is '||x_err_stack );
146: pa_debug.debug(SQLERRM);
147: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
148:
141:
142: WHEN OTHERS THEN
143: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_MC_CUSTREVDISTLINES' );
144: pa_debug.debug('Error stage is '||x_err_stage );
145: pa_debug.debug('Error stack is '||x_err_stack );
146: pa_debug.debug(SQLERRM);
147: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
148:
149: /* ATG NOCOPY changes */
142: WHEN OTHERS THEN
143: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_MC_CUSTREVDISTLINES' );
144: pa_debug.debug('Error stage is '||x_err_stage );
145: pa_debug.debug('Error stack is '||x_err_stack );
146: pa_debug.debug(SQLERRM);
147: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
148:
149: /* ATG NOCOPY changes */
150: p_mcnoofrecordsins := null;
195: l_old_err_stack := x_err_stack;
196:
197: x_err_stack := x_err_stack || ' ->Entering PA_CUSTREVDISTLINES ';
198:
199: pa_debug.debug(x_err_stack);
200:
201: OPEN c_crdl_records;
202:
203: if p_archive_flag = 'Y' then
225: -- in the commit size.
226:
227: /* l_commit_size := pa_utils2.arpur_mrc_commit_size / 2 ; */
228:
229: pa_debug.debug( ' ->Before insert into PA_Revenue_Distribution_Lines_AR') ;
230: IF l_crdl_rowid_tab.LAST is not null THEN
231: IF p_archive_flag = 'Y' THEN
232: FORALL l_crdl_ind in l_crdl_rowid_tab.FIRST .. l_crdl_rowid_tab.LAST
233: insert into PA_CUST_RDL_AR
416: l_NoOfRecordsIns := SQL%ROWCOUNT ;
417: end if;
418:
419:
420: pa_debug.debug( ' ->After insert into PA_Revenue_Distribution_Lines_AR') ;
421:
422: if l_NoOfRecordsIns > 0 then
423: -- First call the MRC procedure to archive the MC table
424: -- We have a seperate delete statement if the archive option is
437: x_err_stage => x_err_stage
438: ) ;
439:
440: end if;
441: pa_debug.debug( ' ->Before delete from pa_cust_rev_dist_lines_all ') ;
442: /* commented and modified as below for performance reasons. Archive Purge 11.5
443: delete from pa_cust_rev_dist_lines_all crdl
444: where (crdl.rowid) in
445: ( select crdl1.rowid
461:
462: l_NoOfRecordsDel := SQL%ROWCOUNT ;
463: l_MC_NoOfRecordsDel := PA_UTILS2.mrc_row_count;
464:
465: pa_debug.debug( ' ->After delete from pa_cust_rev_dist_lines_all ') ;
466:
467:
468: end if ;
469: else
473: -- If the archive option is not selected then the delete will
474: -- be based on the commit size.
475:
476:
477: pa_debug.debug( ' ->Before delete from pa_cust_rev_dist_lines_all ') ;
478: /* commented and modified as below for performance reasons. Archive Purge 11.5
479: delete from pa_cust_rev_dist_lines_all crdl
480: where (crdl.rowid) in
481: ( select crdl1.rowid
495: l_NoOfRecordsDel := SQL%ROWCOUNT ;
496: l_MC_NoOfRecordsDel := PA_UTILS2.mrc_row_count;
497: /*Code Changes for Bug No.2984871 end */
498:
499: pa_debug.debug( ' ->After delete from pa_cust_rev_dist_lines_all ') ;
500: /* end if ; */
501:
502: /* if SQL%ROWCOUNT = 0 then
503: -- Once the SqlCount becomes 0, which means that there are
510: -- the transaction is commited. This also creates a record in the
511: -- Pa_Purge_Project_details which will show the no. of records
512: -- that are purged from each table.
513:
514: pa_debug.debug( ' ->Calling pa_purge.CommitProcess ') ;
515:
516: IF l_NoOfRecordsDel > 0 Then
517: pa_purge.CommitProcess
518: (p_purge_batch_id => p_purge_batch_id,
542: WHEN PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error then
543: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
544:
545: WHEN OTHERS THEN
546: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_CUSTREVDISTLINES' );
547: pa_debug.debug('Error stage is '||x_err_stage );
548: pa_debug.debug('Error stack is '||x_err_stack );
549: pa_debug.debug(SQLERRM);
550: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
543: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
544:
545: WHEN OTHERS THEN
546: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_CUSTREVDISTLINES' );
547: pa_debug.debug('Error stage is '||x_err_stage );
548: pa_debug.debug('Error stack is '||x_err_stack );
549: pa_debug.debug(SQLERRM);
550: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
551:
544:
545: WHEN OTHERS THEN
546: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_CUSTREVDISTLINES' );
547: pa_debug.debug('Error stage is '||x_err_stage );
548: pa_debug.debug('Error stack is '||x_err_stack );
549: pa_debug.debug(SQLERRM);
550: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
551:
552: /* ATG NOCOPY changes */
545: WHEN OTHERS THEN
546: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_CUSTREVDISTLINES' );
547: pa_debug.debug('Error stage is '||x_err_stage );
548: pa_debug.debug('Error stack is '||x_err_stack );
549: pa_debug.debug(SQLERRM);
550: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
551:
552: /* ATG NOCOPY changes */
553: x_err_stack := l_old_err_stack ;
583: l_old_err_stack := x_err_stack;
584:
585: x_err_stack := x_err_stack || ' ->Entering PA_MC_EventRevDistLines ';
586:
587: pa_debug.debug(x_err_stack);
588:
589: pa_debug.debug( ' ->Before insert into Pa_MC_Cust_Event_Rdl_AR') ;
590:
591: /* Commented out for MRC migration to SLA
585: x_err_stack := x_err_stack || ' ->Entering PA_MC_EventRevDistLines ';
586:
587: pa_debug.debug(x_err_stack);
588:
589: pa_debug.debug( ' ->Before insert into Pa_MC_Cust_Event_Rdl_AR') ;
590:
591: /* Commented out for MRC migration to SLA
592: insert into Pa_MC_Cust_Event_Rdl_AR
593: (
649:
650: */
651: p_mcnoofrecordsins := SQL%ROWCOUNT ;
652:
653: pa_debug.debug( ' ->After insert into Pa_MC_Cust_Event_Rdl_AR') ;
654: x_err_stack := l_old_err_stack ;
655:
656: EXCEPTION
657: WHEN PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error then
657: WHEN PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error then
658: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
659:
660: WHEN OTHERS THEN
661: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_MC_EventRevDistLines');
662: pa_debug.debug('Error stage is '||x_err_stage );
663: pa_debug.debug('Error stack is '||x_err_stack );
664: pa_debug.debug(SQLERRM);
665: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM;
658: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
659:
660: WHEN OTHERS THEN
661: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_MC_EventRevDistLines');
662: pa_debug.debug('Error stage is '||x_err_stage );
663: pa_debug.debug('Error stack is '||x_err_stack );
664: pa_debug.debug(SQLERRM);
665: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM;
666:
659:
660: WHEN OTHERS THEN
661: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_MC_EventRevDistLines');
662: pa_debug.debug('Error stage is '||x_err_stage );
663: pa_debug.debug('Error stack is '||x_err_stack );
664: pa_debug.debug(SQLERRM);
665: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM;
666:
667: /* ATG Changes */
660: WHEN OTHERS THEN
661: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_MC_EventRevDistLines');
662: pa_debug.debug('Error stage is '||x_err_stage );
663: pa_debug.debug('Error stack is '||x_err_stack );
664: pa_debug.debug(SQLERRM);
665: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM;
666:
667: /* ATG Changes */
668: p_mcnoofrecordsins := null;
711: l_old_err_stack := x_err_stack;
712:
713: x_err_stack := x_err_stack || ' Entering PA_EventRevDistLines ' ;
714:
715: pa_debug.debug(x_err_stack);
716: IF p_archive_flag = 'Y' THEN
717: l_commit_size := pa_utils2.arpur_mrc_commit_size / 2 ;
718: ELSE
719: l_commit_size := pa_utils2.arpur_mrc_commit_size ;
741: -- in the commit size.
742:
743: /* l_commit_size := pa_utils2.arpur_mrc_commit_size / 2 ; */
744:
745: pa_debug.debug( ' ->Before insert into PA_Cust_Event_RDL_AR') ;
746: FORALL l_erdl_ind IN l_erdl_rowid_tab.FIRST .. l_erdl_rowid_tab.LAST
747: insert into PA_Cust_Event_RDL_AR
748: (
749: PURGE_BATCH_ID,
901: and rownum < l_commit_size
902: ) ;
903: */
904:
905: pa_debug.debug( ' ->After insert into PA_Cust_Event_RDL_AR') ;
906: /* l_NoOfRecordsIns := SQL%ROWCOUNT ; */
907:
908: if l_NoOfRecordsIns > 0 then
909: -- First call the MRC procedure to archive the MC table
922: x_err_stack => x_err_stack,
923: x_err_stage => x_err_stage
924: ) ;
925: end if;
926: pa_debug.debug( ' ->Before delete from pa_cust_event_rdl_all ') ;
927: /* commented and modified as below for performance reasons. Archive Purge 11.5
928: delete from pa_cust_event_rdl_all erdl
929: where (erdl.rowid)
930: in
947: and erdl2.purge_project_id = p_project_id
948: )
949: and erdl.project_id = p_project_id; -- Perf Bug 2695202
950:
951: pa_debug.debug( ' ->After delete from pa_cust_event_rdl_all ') ;
952: */
953: FORALL l_erdl_ind IN l_erdl_rowid_tab.FIRST .. l_erdl_rowid_tab.LAST
954: DELETE FROM PA_CUST_EVENT_RDL_ALL ERDL
955: WHERE ERDL.rowid = l_erdl_rowid_tab(l_erdl_ind);
963:
964: -- If the archive option is not selected then the delete will
965: -- be based on the commit size.
966:
967: pa_debug.debug( ' ->Before delete from pa_cust_event_rdl_all ') ;
968: */
969: /* commented and modified as below for performance reasons. Archive Purge 11.5
970: delete from pa_cust_event_rdl_all erdl
971: where (erdl.rowid)
981: where erdl.project_id = p_project_id
982: and rownum <= l_commit_size;
983: l_NoOfRecordsDel := SQL%ROWCOUNT ;
984: l_MC_NoOfRecordsDel := PA_UTILS2.mrc_row_count;
985: pa_debug.debug( ' ->After delete from pa_cust_event_rdl_all ') ;
986: end if ;
987:
988:
989: if SQL%ROWCOUNT = 0 then
998: -- Pa_Purge_Project_details which will show the no. of records
999: -- that are purged from each table.
1000:
1001: If l_NoOfRecordsDel > 0 Then
1002: pa_debug.debug( ' ->Calling pa_purge.CommitProcess ') ;
1003: pa_purge.CommitProcess
1004: (p_purge_batch_id => p_purge_batch_id,
1005: p_project_id => p_project_id,
1006: p_table_name => 'PA_CUST_EVENT_RDL_ALL',
1028: WHEN PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error then
1029: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
1030:
1031: WHEN OTHERS THEN
1032: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_EventRevDistLines' );
1033: pa_debug.debug('Error stage is '||x_err_stage );
1034: pa_debug.debug('Error stack is '||x_err_stack );
1035: pa_debug.debug(SQLERRM);
1036: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
1029: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
1030:
1031: WHEN OTHERS THEN
1032: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_EventRevDistLines' );
1033: pa_debug.debug('Error stage is '||x_err_stage );
1034: pa_debug.debug('Error stack is '||x_err_stack );
1035: pa_debug.debug(SQLERRM);
1036: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
1037:
1030:
1031: WHEN OTHERS THEN
1032: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_EventRevDistLines' );
1033: pa_debug.debug('Error stage is '||x_err_stage );
1034: pa_debug.debug('Error stack is '||x_err_stack );
1035: pa_debug.debug(SQLERRM);
1036: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
1037:
1038: /* ATG NOCOPY changes */
1031: WHEN OTHERS THEN
1032: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_EventRevDistLines' );
1033: pa_debug.debug('Error stage is '||x_err_stage );
1034: pa_debug.debug('Error stack is '||x_err_stack );
1035: pa_debug.debug(SQLERRM);
1036: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
1037:
1038: /* ATG NOCOPY changes */
1039: x_err_stack := l_old_err_stack ;
1068: l_old_err_stack := x_err_stack;
1069:
1070: x_err_stack := x_err_stack || ' ->Entering PA_MC_Events_Trx ';
1071:
1072: pa_debug.debug(x_err_stack);
1073:
1074: pa_debug.debug( ' ->Before insert into PA_MC_Events_AR') ;
1075:
1076: /* Funding MRC : Added the column description */
1070: x_err_stack := x_err_stack || ' ->Entering PA_MC_Events_Trx ';
1071:
1072: pa_debug.debug(x_err_stack);
1073:
1074: pa_debug.debug( ' ->Before insert into PA_MC_Events_AR') ;
1075:
1076: /* Funding MRC : Added the column description */
1077: /* Commented out for MRC migration to SLA
1078: insert into Pa_Mc_Events_AR
1122: */
1123:
1124: p_mcnoofrecordsins := SQL%ROWCOUNT ;
1125:
1126: pa_debug.debug( ' ->After insert into PA_MC_Events_AR') ;
1127: x_err_stack := l_old_err_stack ;
1128:
1129: EXCEPTION
1130: WHEN PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error then
1130: WHEN PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error then
1131: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
1132:
1133: WHEN OTHERS THEN
1134: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_MC_Events_Trx');
1135: pa_debug.debug('Error stage is '||x_err_stage );
1136: pa_debug.debug('Error stack is '||x_err_stack );
1137: pa_debug.debug(SQLERRM);
1138: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM;
1131: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
1132:
1133: WHEN OTHERS THEN
1134: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_MC_Events_Trx');
1135: pa_debug.debug('Error stage is '||x_err_stage );
1136: pa_debug.debug('Error stack is '||x_err_stack );
1137: pa_debug.debug(SQLERRM);
1138: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM;
1139:
1132:
1133: WHEN OTHERS THEN
1134: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_MC_Events_Trx');
1135: pa_debug.debug('Error stage is '||x_err_stage );
1136: pa_debug.debug('Error stack is '||x_err_stack );
1137: pa_debug.debug(SQLERRM);
1138: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM;
1139:
1140: /* ATG NOCOPY changes */
1133: WHEN OTHERS THEN
1134: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_MC_Events_Trx');
1135: pa_debug.debug('Error stage is '||x_err_stage );
1136: pa_debug.debug('Error stack is '||x_err_stack );
1137: pa_debug.debug(SQLERRM);
1138: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM;
1139:
1140: /* ATG NOCOPY changes */
1141: p_mcnoofrecordsins := null;
1175: l_old_err_stack := x_err_stack;
1176:
1177: x_err_stack := x_err_stack || ' ->Entering PA_EVENT' ;
1178:
1179: pa_debug.debug(x_err_stack);
1180:
1181: LOOP
1182: l_NoOfRecordsDel := 0; -- Value of l_NoOfRecordsDel is reset for BUg 4104133
1183: l_NoOfRecordsIns := 0; -- Value of l_NoOfRecordsIns is reset for BUg 4104133
1190: -- in the commit size.
1191:
1192: l_commit_size := pa_utils2.arpur_mrc_commit_size / 2 ;
1193:
1194: pa_debug.debug( ' ->Before insert into PA_Events_AR') ;
1195:
1196: /* Funding MRC Changes : Added the column zero_revenue_amount_flag */
1197:
1198: insert into PA_Events_AR
1438: ) ;
1439:
1440: l_NoOfRecordsIns := SQL%ROWCOUNT;
1441:
1442: pa_debug.debug( ' ->After insert into PA_Events_AR') ;
1443:
1444:
1445: /*Code Changes for Bug No.2984871 start */
1446: if l_NoOfRecordsIns > 0 then
1462: x_err_stack => x_err_stack,
1463: x_err_stage => x_err_stage
1464: ) ;
1465:
1466: pa_debug.debug( ' ->Before delete from pa_events ') ;
1467: /* commented and modified as below for performance reasons. Archive Purge 11.5
1468: delete from pa_events ev
1469: where (ev.rowid)
1470: in
1490: l_NoOfRecordsDel := SQL%ROWCOUNT ;
1491: l_MC_NoOfRecordsDel := PA_UTILS2.mrc_row_count;
1492: /*Code Changes for Bug No.2984871 end */
1493:
1494: pa_debug.debug( ' ->After delete from pa_events ') ;
1495:
1496:
1497: end if ;
1498: else
1501:
1502: -- If the archive option is not selected then the delete will
1503: -- be based on the commit size.
1504:
1505: pa_debug.debug( ' ->Before delete from pa_events ') ;
1506: /* commented and modified as below for performance reasons. Archive Purge 11.5
1507: delete from pa_events ev
1508: where (ev.rowid)
1509: in
1520: l_NoOfRecordsDel := SQL%ROWCOUNT ;
1521: l_MC_NoOfRecordsDel := PA_UTILS2.mrc_row_count;
1522: /*Code Changes for Bug No.2984871 end */
1523:
1524: pa_debug.debug( ' ->After delete from pa_events ') ;
1525:
1526: end if ;
1527:
1528: /*Code Changes for Bug No.2984871 start */
1539: -- the transaction is commited. This also creates a record in the
1540: -- Pa_Purge_Project_details which will show the no. of records
1541: -- that are purged from each table.
1542:
1543: pa_debug.debug( ' ->Calling pa_purge.CommitProcess ') ;
1544: pa_purge.CommitProcess
1545: (p_purge_batch_id => p_purge_batch_id,
1546: p_project_id => p_project_id,
1547: p_table_name => 'PA_EVENTS',
1566: WHEN PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error then
1567: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
1568:
1569: WHEN OTHERS THEN
1570: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_Event' );
1571: pa_debug.debug('Error stage is '||x_err_stage );
1572: pa_debug.debug('Error stack is '||x_err_stack );
1573: pa_debug.debug(SQLERRM);
1574: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
1567: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
1568:
1569: WHEN OTHERS THEN
1570: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_Event' );
1571: pa_debug.debug('Error stage is '||x_err_stage );
1572: pa_debug.debug('Error stack is '||x_err_stack );
1573: pa_debug.debug(SQLERRM);
1574: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
1575:
1568:
1569: WHEN OTHERS THEN
1570: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_Event' );
1571: pa_debug.debug('Error stage is '||x_err_stage );
1572: pa_debug.debug('Error stack is '||x_err_stack );
1573: pa_debug.debug(SQLERRM);
1574: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
1575:
1576: /* ATG NOCOPY changes */
1569: WHEN OTHERS THEN
1570: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_Event' );
1571: pa_debug.debug('Error stage is '||x_err_stage );
1572: pa_debug.debug('Error stack is '||x_err_stack );
1573: pa_debug.debug(SQLERRM);
1574: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
1575:
1576: /* ATG NOCOPY changes */
1577: x_err_stack := l_old_err_stack ;
1608: l_old_err_stack := x_err_stack;
1609:
1610: x_err_stack := x_err_stack || ' ->Entering PA_DRAFTREVITEMS ' ;
1611:
1612: pa_debug.debug(x_err_stack);
1613:
1614: LOOP
1615: l_NoOfRecordsDel := 0; -- Value of l_NoOfRecordsDel is reset for BUg 4104133
1616: l_NoOfRecordsIns := 0; -- Value of l_NoOfRecordsIns is reset for BUg 4104133
1622: -- in the commit size.
1623:
1624: l_commit_size := pa_utils2.arpur_mrc_commit_size / 2 ;
1625:
1626: pa_debug.debug( ' ->Before insert into PA_DRAFT_REV_ITEMS_AR') ;
1627: insert into PA_DRAFT_REV_ITEMS_AR (
1628: PURGE_BATCH_ID,
1629: PURGE_RELEASE,
1630: PURGE_PROJECT_ID,
1686: ) ;
1687:
1688: l_NoOfRecordsIns := SQL%ROWCOUNT ;
1689:
1690: pa_debug.debug( ' ->After insert into PA_DRAFT_REV_ITEMS_AR') ;
1691:
1692: /*Code Changes for Bug No.2984871 start */
1693: if l_NoOfRecordsIns > 0 then
1694: /*Code Changes for Bug No.2984871 end */
1697: -- selected because if archive option is selected the the records
1698: -- being purged will be those records which are already archived.
1699: -- table and
1700:
1701: pa_debug.debug( ' ->Before delete from pa_draft_revenue_items ') ;
1702: /* commented and modified as below for performance reasons. Archive Purge 11.5
1703: delete from pa_draft_revenue_items dri
1704: where (dri.rowid)
1705: in
1730: /*Code Changes for Bug No.2984871 start */
1731: l_NoOfRecordsDel := SQL%ROWCOUNT ;
1732: /*Code Changes for Bug No.2984871 end */
1733:
1734: pa_debug.debug( ' ->After delete from pa_draft_revenue_items ') ;
1735:
1736: end if ;
1737: else
1738:
1740:
1741: -- If the archive option is not selected then the delete will
1742: -- be based on the commit size.
1743:
1744: pa_debug.debug( ' ->Before delete from pa_draft_revenue_items ') ;
1745: /* commented and modified as below for performance reasons. Archive Purge 11.5
1746: delete from pa_draft_revenue_items dri
1747: where (dri.rowid)
1748: in
1758: /*Code Changes for Bug No.2984871 start */
1759: l_NoOfRecordsDel := SQL%ROWCOUNT ;
1760: /*Code Changes for Bug No.2984871 end */
1761:
1762: pa_debug.debug( ' ->After delete from pa_draft_revenue_items ') ;
1763: end if ;
1764:
1765: /*Code Changes for Bug No.2984871 start */
1766: if l_NoOfRecordsDel= 0 then
1775: -- the transaction is commited. This also creates a record in the
1776: -- Pa_Purge_Project_details which will show the no. of records
1777: -- that are purged from each table.
1778:
1779: pa_debug.debug( ' ->Calling pa_purge.CommitProcess ') ;
1780: pa_purge.CommitProcess
1781: (p_purge_batch_id => p_purge_batch_id,
1782: p_project_id => p_project_id,
1783: p_table_name => 'PA_DRAFT_REVENUE_ITEMS',
1797: WHEN PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error then
1798: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
1799:
1800: WHEN OTHERS THEN
1801: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_DraftRevItems' );
1802: pa_debug.debug('Error stage is '||x_err_stage );
1803: pa_debug.debug('Error stack is '||x_err_stack );
1804: pa_debug.debug(SQLERRM);
1805: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
1798: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
1799:
1800: WHEN OTHERS THEN
1801: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_DraftRevItems' );
1802: pa_debug.debug('Error stage is '||x_err_stage );
1803: pa_debug.debug('Error stack is '||x_err_stack );
1804: pa_debug.debug(SQLERRM);
1805: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
1806:
1799:
1800: WHEN OTHERS THEN
1801: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_DraftRevItems' );
1802: pa_debug.debug('Error stage is '||x_err_stage );
1803: pa_debug.debug('Error stack is '||x_err_stack );
1804: pa_debug.debug(SQLERRM);
1805: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
1806:
1807: /* ATG NOCOPY changes */
1800: WHEN OTHERS THEN
1801: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_DraftRevItems' );
1802: pa_debug.debug('Error stage is '||x_err_stage );
1803: pa_debug.debug('Error stack is '||x_err_stack );
1804: pa_debug.debug(SQLERRM);
1805: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
1806:
1807: /* ATG NOCOPY changes */
1808: x_err_stack := l_old_err_stack ;
1838: l_old_err_stack := x_err_stack;
1839:
1840: x_err_stack := x_err_stack || ' ->Entering PA_MC_DRAFTINVOICEITEMS ';
1841:
1842: pa_debug.debug(x_err_stack);
1843:
1844: pa_debug.debug( ' ->Before insert into PA_MC_DRAFT_INV_ITMS_AR') ;
1845:
1846: /* Commented out for MRC migration to SLA insert into PA_MC_DRAFT_INV_ITMS_AR
1840: x_err_stack := x_err_stack || ' ->Entering PA_MC_DRAFTINVOICEITEMS ';
1841:
1842: pa_debug.debug(x_err_stack);
1843:
1844: pa_debug.debug( ' ->Before insert into PA_MC_DRAFT_INV_ITMS_AR') ;
1845:
1846: /* Commented out for MRC migration to SLA insert into PA_MC_DRAFT_INV_ITMS_AR
1847: (
1848: Purge_Batch_Id,
1886: and mc.Line_Num = ar.Line_Num;
1887: */
1888: p_mcnoofrecordsins := SQL%ROWCOUNT ;
1889:
1890: pa_debug.debug( ' ->After insert into PA_MC_DRAFT_INV_ITMS_AR') ;
1891: x_err_stack := l_old_err_stack ;
1892:
1893: EXCEPTION
1894: WHEN PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error then
1894: WHEN PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error then
1895: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
1896:
1897: WHEN OTHERS THEN
1898: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_MC_DRAFTINVOICEITEMS' );
1899: pa_debug.debug('Error stage is '||x_err_stage );
1900: pa_debug.debug('Error stack is '||x_err_stack );
1901: pa_debug.debug(SQLERRM);
1902: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
1895: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
1896:
1897: WHEN OTHERS THEN
1898: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_MC_DRAFTINVOICEITEMS' );
1899: pa_debug.debug('Error stage is '||x_err_stage );
1900: pa_debug.debug('Error stack is '||x_err_stack );
1901: pa_debug.debug(SQLERRM);
1902: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
1903:
1896:
1897: WHEN OTHERS THEN
1898: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_MC_DRAFTINVOICEITEMS' );
1899: pa_debug.debug('Error stage is '||x_err_stage );
1900: pa_debug.debug('Error stack is '||x_err_stack );
1901: pa_debug.debug(SQLERRM);
1902: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
1903:
1904: /* ATG NOCOPY changes */
1897: WHEN OTHERS THEN
1898: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_MC_DRAFTINVOICEITEMS' );
1899: pa_debug.debug('Error stage is '||x_err_stage );
1900: pa_debug.debug('Error stack is '||x_err_stack );
1901: pa_debug.debug(SQLERRM);
1902: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
1903:
1904: /* ATG NOCOPY changes */
1905: p_mcnoofrecordsins := null;
1940: l_old_err_stack := x_err_stack;
1941:
1942: x_err_stack := x_err_stack || ' ->Entering PA_DRAFT_INVOICE_ITEMS' ;
1943:
1944: pa_debug.debug(x_err_stack);
1945:
1946: LOOP
1947: l_NoOfRecordsDel := 0; -- Value of l_NoOfRecordsDel is reset for BUg 4104133
1948: l_NoOfRecordsIns := 0; -- Value of l_NoOfRecordsIns is reset for BUg 4104133
1954: -- in the commit size.
1955:
1956: l_commit_size := pa_utils2.arpur_mrc_commit_size / 2 ;
1957:
1958: pa_debug.debug( ' ->Before insert into PA_DRAFT_INV_ITEMS_AR') ;
1959: insert into PA_DRAFT_INV_ITEMS_AR (
1960: PURGE_BATCH_ID,
1961: PURGE_RELEASE,
1962: PURGE_PROJECT_ID,
2094: l_NoOfRecordsIns := SQL%ROWCOUNT ;
2095: /*Code Changes for Bug No.2984871 end */
2096:
2097:
2098: pa_debug.debug( ' ->After insert into PA_DRAFT_INV_ITEMS_AR') ;
2099:
2100: /*Code Changes for Bug No.2984871 start */
2101: if l_NoOfRecordsIns > 0 then
2102: /*Code Changes for Bug No.2984871 end */
2116: x_err_stack => x_err_stack,
2117: x_err_stage => x_err_stage
2118: ) ;
2119:
2120: pa_debug.debug( ' ->Before delete from pa_draft_invoice_items ') ;
2121: /* commented and modified as below for performance reasons. Archive Purge 11.5
2122: delete from pa_draft_invoice_items dii
2123: where (dii.rowid)
2124: in
2151: l_NoOfRecordsDel := SQL%ROWCOUNT ;
2152: l_MC_NoOfRecordsDel := PA_UTILS2.mrc_row_count;
2153: /*Code Changes for Bug No.2984871 end */
2154:
2155: pa_debug.debug( ' ->After delete from pa_draft_invoice_items ') ;
2156:
2157: end if ;
2158: else
2159:
2161:
2162: -- If the archive option is not selected then the delete will
2163: -- be based on the commit size.
2164:
2165: pa_debug.debug( ' ->Before delete from pa_draft_invoice_items ') ;
2166: /* commented and modified as below for performance reasons. Archive Purge 11.5
2167: delete from pa_draft_invoice_items dii
2168: where (dii.rowid)
2169: in
2181: l_NoOfRecordsDel := SQL%ROWCOUNT ;
2182: l_MC_NoOfRecordsDel := PA_UTILS2.mrc_row_count;
2183: /*Code Changes for Bug No.2984871 end */
2184:
2185: pa_debug.debug( ' ->After delete from pa_draft_invoice_items ') ;
2186:
2187: end if ;
2188:
2189: /*Code Changes for Bug No.2984871 start */
2199: -- the transaction is commited. This also creates a record in the
2200: -- Pa_Purge_Project_details which will show the no. of records
2201: -- that are purged from each table.
2202:
2203: pa_debug.debug( ' ->Calling pa_purge.CommitProcess ') ;
2204: pa_purge.CommitProcess
2205: (p_purge_batch_id => p_purge_batch_id,
2206: p_project_id => p_project_id,
2207: p_table_name => 'PA_DRAFT_INVOICE_ITEMS',
2226: WHEN PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error then
2227: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
2228:
2229: WHEN OTHERS THEN
2230: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_DraftInvItems' );
2231: pa_debug.debug('Error stage is '||x_err_stage );
2232: pa_debug.debug('Error stack is '||x_err_stack );
2233: pa_debug.debug(SQLERRM);
2234: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
2227: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
2228:
2229: WHEN OTHERS THEN
2230: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_DraftInvItems' );
2231: pa_debug.debug('Error stage is '||x_err_stage );
2232: pa_debug.debug('Error stack is '||x_err_stack );
2233: pa_debug.debug(SQLERRM);
2234: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
2235:
2228:
2229: WHEN OTHERS THEN
2230: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_DraftInvItems' );
2231: pa_debug.debug('Error stage is '||x_err_stage );
2232: pa_debug.debug('Error stack is '||x_err_stack );
2233: pa_debug.debug(SQLERRM);
2234: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
2235:
2236: /* ATG NOCOPY changes */
2229: WHEN OTHERS THEN
2230: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_DraftInvItems' );
2231: pa_debug.debug('Error stage is '||x_err_stage );
2232: pa_debug.debug('Error stack is '||x_err_stack );
2233: pa_debug.debug(SQLERRM);
2234: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
2235:
2236: /* ATG NOCOPY changes */
2237: x_err_stack := l_old_err_stack ;
2267: l_old_err_stack := x_err_stack;
2268:
2269: x_err_stack := x_err_stack || ' ->Entering PA_MC_RETNINVDETAILS ';
2270:
2271: pa_debug.debug(x_err_stack);
2272:
2273: pa_debug.debug( ' ->Before insert into PA_MC_RETN_INV_DETLS_AR') ;
2274:
2275: /* Commented out for MRC migration to SLA
2269: x_err_stack := x_err_stack || ' ->Entering PA_MC_RETNINVDETAILS ';
2270:
2271: pa_debug.debug(x_err_stack);
2272:
2273: pa_debug.debug( ' ->Before insert into PA_MC_RETN_INV_DETLS_AR') ;
2274:
2275: /* Commented out for MRC migration to SLA
2276: insert into PA_MC_RETN_INV_DETLS_AR
2277: (
2328:
2329: */
2330: p_mcnoofrecordsins := SQL%ROWCOUNT ;
2331:
2332: pa_debug.debug( ' ->After insert into PA_MC_RETN_INV_DETLS_AR') ;
2333: x_err_stack := l_old_err_stack ;
2334:
2335: EXCEPTION
2336: WHEN PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error then
2336: WHEN PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error then
2337: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
2338:
2339: WHEN OTHERS THEN
2340: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_MC_RETNINVDETAILS' );
2341: pa_debug.debug('Error stage is '||x_err_stage );
2342: pa_debug.debug('Error stack is '||x_err_stack );
2343: pa_debug.debug(SQLERRM);
2344: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
2337: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
2338:
2339: WHEN OTHERS THEN
2340: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_MC_RETNINVDETAILS' );
2341: pa_debug.debug('Error stage is '||x_err_stage );
2342: pa_debug.debug('Error stack is '||x_err_stack );
2343: pa_debug.debug(SQLERRM);
2344: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
2345:
2338:
2339: WHEN OTHERS THEN
2340: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_MC_RETNINVDETAILS' );
2341: pa_debug.debug('Error stage is '||x_err_stage );
2342: pa_debug.debug('Error stack is '||x_err_stack );
2343: pa_debug.debug(SQLERRM);
2344: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
2345:
2346: /* ATG NOCOPY changes */
2339: WHEN OTHERS THEN
2340: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_MC_RETNINVDETAILS' );
2341: pa_debug.debug('Error stage is '||x_err_stage );
2342: pa_debug.debug('Error stack is '||x_err_stack );
2343: pa_debug.debug(SQLERRM);
2344: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
2345:
2346: /* ATG NOCOPY changes */
2347: p_mcnoofrecordsins := null;
2381: l_old_err_stack := x_err_stack;
2382:
2383: x_err_stack := x_err_stack || ' ->Entering PA_RETN_INVOICE_DETAILS' ;
2384:
2385: pa_debug.debug(x_err_stack);
2386:
2387: LOOP
2388: l_NoOfRecordsDel := 0; -- Value of l_NoOfRecordsDel is reset for BUg 4104133
2389: l_NoOfRecordsIns := 0; -- Value of l_NoOfRecordsIns is reset for BUg 4104133
2395: -- in the commit size.
2396:
2397: l_commit_size := pa_utils2.arpur_mrc_commit_size / 2 ;
2398:
2399: pa_debug.debug( ' ->Before insert into PA_RETN_INV_DETAILS_AR') ;
2400: insert into PA_RETN_INV_DETAILS_AR (
2401: PURGE_BATCH_ID,
2402: PURGE_RELEASE,
2403: PURGE_PROJECT_ID,
2455: ) ;
2456:
2457: l_NoOfRecordsIns := SQL%ROWCOUNT ;
2458:
2459: pa_debug.debug( ' ->After insert into PA_RETN_INV_DETAILS_AR') ;
2460:
2461: /*Code Changes for Bug No.2984871 start */
2462: if l_NoOfRecordsIns > 0 then
2463: /*Code Changes for Bug No.2984871 end */
2479: x_err_stage => x_err_stage
2480: ) ;
2481:
2482: /* Added the code to delete the records from the MC table of Pa_Retn_Invoice_Details for bug#2272487, starts here*/
2483: pa_debug.debug( ' ->Before delete from Pa_MC_Retn_Inv_Details ') ;
2484:
2485: /* Commented out for MRC migration to SLA delete from Pa_MC_Retn_Inv_Details rid
2486: where (rid.project_id, rid.draft_invoice_num) in
2487: ( select rid2.project_id, rid2.draft_invoice_num
2492: /*Code Changes for Bug No.2984871 start */
2493: l_MC_NoOfRecordsDel := SQL%ROWCOUNT;
2494: /*Code Changes for Bug No.2984871 end */
2495:
2496: pa_debug.debug( ' ->After delete from Pa_MC_Retn_Inv_Details ') ;
2497:
2498: /* Added the code to delete the records from the MC table of Pa_Retn_Invoice_Details for bug#2272487, ends here*/
2499:
2500: pa_debug.debug( ' ->Before delete from PA_Retn_Invoice_Details ') ;
2496: pa_debug.debug( ' ->After delete from Pa_MC_Retn_Inv_Details ') ;
2497:
2498: /* Added the code to delete the records from the MC table of Pa_Retn_Invoice_Details for bug#2272487, ends here*/
2499:
2500: pa_debug.debug( ' ->Before delete from PA_Retn_Invoice_Details ') ;
2501: /* commented and modified as below for performance reasons. Archive Purge 11.5
2502: delete from PA_Retn_Invoice_Details rid
2503: where (rid.rowid)
2504: in
2521: /*Code Changes for Bug No.2984871 start */
2522: l_NoOfRecordsDel := SQL%ROWCOUNT ;
2523: /*Code Changes for Bug No.2984871 end */
2524:
2525: pa_debug.debug( ' ->After delete from PA_Retn_Invoice_Details ') ;
2526:
2527: end if ;
2528: else
2529:
2533: -- be based on the commit size.
2534:
2535:
2536: /* Added the code to delete the records from the MC table of Pa_Retn_Invoice_Details for bug#2272487, starts here */
2537: pa_debug.debug( ' ->Before delete from Pa_MC_Retn_Inv_Details ') ;
2538:
2539: /* Commented out for MRC migration to SLA delete from Pa_MC_Retn_Inv_Details rid
2540: where rid.project_id = p_project_id
2541: and rownum <= l_commit_size; */
2542: -- Code Changes for Bug No.2984871 start
2543: l_MC_NoOfRecordsDel := SQL%ROWCOUNT;
2544: -- Code Changes for Bug No.2984871 end
2545:
2546: pa_debug.debug( ' ->After delete from Pa_MC_Retn_Inv_Details ') ;
2547:
2548: /* Added the code to delete the records from the MC table of Pa_Retn_Invoice_Details for bug#2272487, ends here */
2549:
2550: pa_debug.debug( ' ->Before delete from PA_Retn_Invoice_Details ') ;
2546: pa_debug.debug( ' ->After delete from Pa_MC_Retn_Inv_Details ') ;
2547:
2548: /* Added the code to delete the records from the MC table of Pa_Retn_Invoice_Details for bug#2272487, ends here */
2549:
2550: pa_debug.debug( ' ->Before delete from PA_Retn_Invoice_Details ') ;
2551: /* commented and modified as below for performance reasons. Archive Purge 11.5
2552: delete from PA_Retn_Invoice_Details rid
2553: where (rid.rowid)
2554: in
2564: /*Code Changes for Bug No.2984871 start */
2565: l_NoOfRecordsDel := SQL%ROWCOUNT ;
2566: /*Code Changes for Bug No.2984871 end */
2567:
2568: pa_debug.debug( ' ->After delete from PA_Retn_Invoice_Details ') ;
2569:
2570: end if ;
2571:
2572: if l_NoOfRecordsDel = 0 then
2580: -- the transaction is commited. This also creates a record in the
2581: -- Pa_Purge_Project_details which will show the no. of records
2582: -- that are purged from each table.
2583:
2584: pa_debug.debug( ' ->Calling pa_purge.CommitProcess ') ;
2585: pa_purge.CommitProcess
2586: (p_purge_batch_id => p_purge_batch_id,
2587: p_project_id => p_project_id,
2588: p_table_name => 'PA_RETN_INVOICE_DETAILS',
2607: WHEN PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error then
2608: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
2609:
2610: WHEN OTHERS THEN
2611: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_RetnInvDetails' );
2612: pa_debug.debug('Error stage is '||x_err_stage );
2613: pa_debug.debug('Error stack is '||x_err_stack );
2614: pa_debug.debug(SQLERRM);
2615: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
2608: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
2609:
2610: WHEN OTHERS THEN
2611: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_RetnInvDetails' );
2612: pa_debug.debug('Error stage is '||x_err_stage );
2613: pa_debug.debug('Error stack is '||x_err_stack );
2614: pa_debug.debug(SQLERRM);
2615: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
2616:
2609:
2610: WHEN OTHERS THEN
2611: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_RetnInvDetails' );
2612: pa_debug.debug('Error stage is '||x_err_stage );
2613: pa_debug.debug('Error stack is '||x_err_stack );
2614: pa_debug.debug(SQLERRM);
2615: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
2616:
2617: /* ATG NOCOPY changes */
2610: WHEN OTHERS THEN
2611: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_RetnInvDetails' );
2612: pa_debug.debug('Error stage is '||x_err_stage );
2613: pa_debug.debug('Error stack is '||x_err_stack );
2614: pa_debug.debug(SQLERRM);
2615: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
2616:
2617: /* ATG NOCOPY changes */
2618: x_err_stack := l_old_err_stack ;
2649: l_old_err_stack := x_err_stack;
2650:
2651: x_err_stack := x_err_stack || ' ->Entering PA_MC_DRAFTREVENUES ';
2652:
2653: pa_debug.debug(x_err_stack);
2654:
2655: pa_debug.debug( ' ->Before insert into Pa_MC_Draft_Revs_AR') ;
2656:
2657: /* Commented out for MRC migration to SLA insert into Pa_MC_Draft_Revs_AR
2651: x_err_stack := x_err_stack || ' ->Entering PA_MC_DRAFTREVENUES ';
2652:
2653: pa_debug.debug(x_err_stack);
2654:
2655: pa_debug.debug( ' ->Before insert into Pa_MC_Draft_Revs_AR') ;
2656:
2657: /* Commented out for MRC migration to SLA insert into Pa_MC_Draft_Revs_AR
2658: (
2659: Purge_Batch_Id,
2714:
2715: */
2716: p_mcnoofrecordsins := SQL%ROWCOUNT ;
2717:
2718: pa_debug.debug( ' ->After insert into Pa_MC_Draft_Revs_AR') ;
2719: x_err_stack := l_old_err_stack ;
2720:
2721: EXCEPTION
2722: WHEN PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error then
2722: WHEN PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error then
2723: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
2724:
2725: WHEN OTHERS THEN
2726: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_MC_DRAFTREVENUES' );
2727: pa_debug.debug('Error stage is '||x_err_stage );
2728: pa_debug.debug('Error stack is '||x_err_stack );
2729: pa_debug.debug(SQLERRM);
2730: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
2723: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
2724:
2725: WHEN OTHERS THEN
2726: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_MC_DRAFTREVENUES' );
2727: pa_debug.debug('Error stage is '||x_err_stage );
2728: pa_debug.debug('Error stack is '||x_err_stack );
2729: pa_debug.debug(SQLERRM);
2730: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
2731:
2724:
2725: WHEN OTHERS THEN
2726: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_MC_DRAFTREVENUES' );
2727: pa_debug.debug('Error stage is '||x_err_stage );
2728: pa_debug.debug('Error stack is '||x_err_stack );
2729: pa_debug.debug(SQLERRM);
2730: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
2731:
2732: /* ATG NOCOPY CHANGES */
2725: WHEN OTHERS THEN
2726: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_MC_DRAFTREVENUES' );
2727: pa_debug.debug('Error stage is '||x_err_stage );
2728: pa_debug.debug('Error stack is '||x_err_stack );
2729: pa_debug.debug(SQLERRM);
2730: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
2731:
2732: /* ATG NOCOPY CHANGES */
2733: p_mcnoofrecordsins := NULL;
2767: l_old_err_stack := x_err_stack;
2768:
2769: x_err_stack := x_err_stack || ' ->Entering PA_DRAFTREVENUES' ;
2770:
2771: pa_debug.debug(x_err_stack);
2772: LOOP
2773: l_NoOfRecordsDel := 0; -- Value of l_NoOfRecordsDel is reset for BUg 4104133
2774: l_NoOfRecordsIns := 0; -- Value of l_NoOfRecordsDel is reset for BUg 4104133
2775: if p_archive_flag = 'Y' then
2780: -- in the commit size.
2781:
2782: l_commit_size := pa_utils2.arpur_mrc_commit_size / 2 ;
2783:
2784: pa_debug.debug( ' ->Before insert into PA_Draft_Revenues_AR') ;
2785: insert into PA_Draft_Revenues_AR (
2786: PURGE_BATCH_ID,
2787: PURGE_RELEASE,
2788: PURGE_PROJECT_ID,
2885: and rownum <= l_commit_size
2886: ) ;
2887:
2888: l_NoOfRecordsIns := SQL%ROWCOUNT ;
2889: pa_debug.debug( ' ->After insert into PA_Draft_Revenues_AR') ;
2890:
2891: if l_NoOfRecordsIns > 0 then
2892: -- First call the MRC procedure to archive the MC table
2893: -- We have a seperate delete statement if the archive option is
2905: x_err_stack => x_err_stack,
2906: x_err_stage => x_err_stage
2907: ) ;
2908:
2909: pa_debug.debug( ' ->Before delete from pa_draft_revenues_all ') ;
2910: /* commented and modified as below for performance reasons. Archive Purge 11.5
2911: delete from pa_draft_revenues_all dr
2912: where (dr.rowid)
2913: in
2929: /*Code Changes for Bug No.2984871 start */
2930: l_NoOfRecordsDel := SQL%ROWCOUNT ;
2931: l_MC_NoOfRecordsDel := PA_UTILS2.mrc_row_count;
2932: /*Code Changes for Bug No.2984871 end */
2933: pa_debug.debug( ' ->After delete from pa_draft_revenues_all ') ;
2934:
2935: end if ;
2936: else
2937:
2939:
2940: -- If the archive option is not selected then the delete will
2941: -- be based on the commit size.
2942:
2943: pa_debug.debug( ' ->Before delete from pa_draft_revenues_all ') ;
2944: /* commented and modified as below for performance reasons. Archive Purge 11.5
2945: delete from pa_draft_revenues_all dr
2946: where (dr.rowid)
2947: in
2959: /*Code Changes for Bug No.2984871 start */
2960: l_NoOfRecordsDel := SQL%ROWCOUNT ;
2961: l_MC_NoOfRecordsDel := PA_UTILS2.mrc_row_count;
2962: /*Code Changes for Bug No.2984871 end */
2963: pa_debug.debug( ' ->After delete from pa_draft_revenues_all ') ;
2964: end if ;
2965:
2966: if l_NoOfRecordsDel = 0 then
2967: -- Once the SqlCount becomes 0, which means that there are
2974: -- the transaction is commited. This also creates a record in the
2975: -- Pa_Purge_Project_details which will show the no. of records
2976: -- that are purged from each table.
2977:
2978: pa_debug.debug( ' ->Calling pa_purge.CommitProcess ') ;
2979: pa_purge.CommitProcess
2980: (p_purge_batch_id => p_purge_batch_id,
2981: p_project_id => p_project_id,
2982: p_table_name => 'PA_DRAFT_REVENUES_ALL',
3001: WHEN PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error then
3002: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
3003:
3004: WHEN OTHERS THEN
3005: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_DraftRevenues' );
3006: pa_debug.debug('Error stage is '||x_err_stage );
3007: pa_debug.debug('Error stack is '||x_err_stack );
3008: pa_debug.debug(SQLERRM);
3009: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
3002: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
3003:
3004: WHEN OTHERS THEN
3005: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_DraftRevenues' );
3006: pa_debug.debug('Error stage is '||x_err_stage );
3007: pa_debug.debug('Error stack is '||x_err_stack );
3008: pa_debug.debug(SQLERRM);
3009: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
3010:
3003:
3004: WHEN OTHERS THEN
3005: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_DraftRevenues' );
3006: pa_debug.debug('Error stage is '||x_err_stage );
3007: pa_debug.debug('Error stack is '||x_err_stack );
3008: pa_debug.debug(SQLERRM);
3009: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
3010:
3011: /* ATG NOPCOPY changes */
3004: WHEN OTHERS THEN
3005: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_DraftRevenues' );
3006: pa_debug.debug('Error stage is '||x_err_stage );
3007: pa_debug.debug('Error stack is '||x_err_stack );
3008: pa_debug.debug(SQLERRM);
3009: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
3010:
3011: /* ATG NOPCOPY changes */
3012:
3044: l_old_err_stack := x_err_stack;
3045:
3046: x_err_stack := x_err_stack || ' ->Entering PA_DRAFTINVOICES' ;
3047:
3048: pa_debug.debug(x_err_stack);
3049:
3050: LOOP
3051: l_NoOfRecordsDel := 0; -- Value of l_NoOfRecordsDel is reset for BUg 4104133
3052: l_NoOfRecordsIns := 0; -- Value of l_NoOfRecordsDel is reset for BUg 4104133
3058: -- in the commit size.
3059:
3060: l_commit_size := pa_utils2.arpur_mrc_commit_size / 2 ;
3061:
3062: pa_debug.debug( ' ->Before insert into PA_Draft_Invoices_AR') ;
3063: insert into PA_Draft_Invoices_AR (
3064: PURGE_BATCH_ID,
3065: PURGE_RELEASE,
3066: PURGE_PROJECT_ID,
3242: ) ;
3243:
3244: l_NoOfRecordsIns := SQL%ROWCOUNT ;
3245:
3246: pa_debug.debug( ' ->After insert into PA_Draft_Invoices_AR') ;
3247: if l_NoOfRecordsIns > 0 then
3248: -- We have a seperate delete statement if the archive option is
3249: -- selected because if archive option is selected the the records
3250: -- being purged will be those records which are already archived.
3249: -- selected because if archive option is selected the the records
3250: -- being purged will be those records which are already archived.
3251: -- table and
3252:
3253: pa_debug.debug( ' ->Before delete from pa_draft_invoices_all ') ;
3254: /* commented and modified as below for performance reasons. Archive Purge 11.5
3255: delete from pa_draft_invoices_all di
3256: where (di.rowid)
3257: in
3270: from pa_draft_invoices_ar di2
3271: where di2.purge_project_id = p_project_id
3272: ) ;
3273:
3274: pa_debug.debug( ' ->After delete from pa_draft_invoices_all ') ;
3275:
3276: l_NoOfRecordsDel := SQL%ROWCOUNT ;
3277: end if ;
3278: else
3281:
3282: -- If the archive option is not selected then the delete will
3283: -- be based on the commit size.
3284:
3285: pa_debug.debug( ' ->Before delete from pa_draft_invoices_all ') ;
3286: /* commented and modified as below for performance reasons. Archive Purge 11.5
3287: delete from pa_draft_invoices_all di
3288: where (di.rowid)
3289: in
3300:
3301: /*Code Changes for Bug No.2984871 start */
3302: l_NoOfRecordsDel := SQL%ROWCOUNT ;
3303: /*Code Changes for Bug No.2984871 end */
3304: pa_debug.debug( ' ->After delete from pa_draft_invoices_all ') ;
3305: end if ;
3306:
3307: if l_NoOfRecordsDel = 0 then
3308: -- Once the SqlCount becomes 0, which means that there are
3315: -- the transaction is commited. This also creates a record in the
3316: -- Pa_Purge_Project_details which will show the no. of records
3317: -- that are purged from each table.
3318:
3319: pa_debug.debug( ' ->Calling pa_purge.CommitProcess ') ;
3320: pa_purge.CommitProcess
3321: (p_purge_batch_id => p_purge_batch_id,
3322: p_project_id => p_project_id,
3323: p_table_name => 'PA_DRAFT_INVOICES_ALL',
3336: WHEN PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error then
3337: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
3338:
3339: WHEN OTHERS THEN
3340: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_DraftInvoices' );
3341: pa_debug.debug('Error stage is '||x_err_stage );
3342: pa_debug.debug('Error stack is '||x_err_stack );
3343: pa_debug.debug(SQLERRM);
3344: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
3337: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
3338:
3339: WHEN OTHERS THEN
3340: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_DraftInvoices' );
3341: pa_debug.debug('Error stage is '||x_err_stage );
3342: pa_debug.debug('Error stack is '||x_err_stack );
3343: pa_debug.debug(SQLERRM);
3344: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
3345:
3338:
3339: WHEN OTHERS THEN
3340: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_DraftInvoices' );
3341: pa_debug.debug('Error stage is '||x_err_stage );
3342: pa_debug.debug('Error stack is '||x_err_stack );
3343: pa_debug.debug(SQLERRM);
3344: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
3345:
3346: /* ATG NOCOPY CHANGES */
3339: WHEN OTHERS THEN
3340: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_DraftInvoices' );
3341: pa_debug.debug('Error stage is '||x_err_stage );
3342: pa_debug.debug('Error stack is '||x_err_stack );
3343: pa_debug.debug(SQLERRM);
3344: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
3345:
3346: /* ATG NOCOPY CHANGES */
3347: x_err_stack := l_old_err_stack;
3378: l_old_err_stack := x_err_stack;
3379:
3380: x_err_stack := x_err_stack || ' ->Entering PA_DISTWARNINGS' ;
3381:
3382: pa_debug.debug(x_err_stack);
3383:
3384: LOOP
3385: l_NoOfRecordsDel := 0; -- Value of l_NoOfRecordsDel is reset for BUg 4104133
3386: l_NoOfRecordsIns := 0; -- Value of l_NoOfRecordsDel is reset for BUg 4104133
3392: -- in the commit size.
3393:
3394: l_commit_size := pa_utils2.arpur_mrc_commit_size / 2 ;
3395:
3396: pa_debug.debug( ' ->Before insert into PA_DIST_WARNINGS_AR') ;
3397: insert into PA_DIST_WARNINGS_AR (
3398: PURGE_BATCH_ID,
3399: PURGE_RELEASE,
3400: PURGE_PROJECT_ID,
3441: and rownum <= l_commit_size
3442: ) ;
3443:
3444: l_NoOfRecordsIns := SQL%ROWCOUNT ;
3445: pa_debug.debug( ' ->After insert into PA_DIST_WARNINGS_AR') ;
3446:
3447: /*Code Changes for Bug No.2984871 start */
3448: if l_NoOfRecordsIns > 0 then
3449: /*Code Changes for Bug No.2984871 end */
3451: -- selected because if archive option is selected the the records
3452: -- being purged will be those records which are already archived.
3453: -- table and
3454:
3455: pa_debug.debug( ' ->Before delete from pa_distribution_warnings ') ;
3456: /* commented and modified as below for performance reasons. Archive Purge 11.5
3457: delete from pa_distribution_warnings dw
3458: where (dw.rowid)
3459: in
3483:
3484: /*Code Changes for Bug No.2984871 start */
3485: l_NoOfRecordsDel := SQL%ROWCOUNT ;
3486: /*Code Changes for Bug No.2984871 end */
3487: pa_debug.debug( ' ->After delete from pa_distribution_warnings ') ;
3488:
3489: end if ;
3490: else
3491:
3493:
3494: -- If the archive option is not selected then the delete will
3495: -- be based on the commit size.
3496:
3497: pa_debug.debug( ' ->Before delete from pa_distribution_warnings ') ;
3498: /* commented and modified as below for performance reasons. Archive Purge 11.5
3499: delete from pa_distribution_warnings dw
3500: where (dw.rowid)
3501: in
3510: and rownum <= l_commit_size;
3511: /*Code Changes for Bug No.2984871 start */
3512: l_NoOfRecordsDel := SQL%ROWCOUNT ;
3513: /*Code Changes for Bug No.2984871 end */
3514: pa_debug.debug( ' ->After delete from pa_distribution_warnings ') ;
3515:
3516: end if ;
3517:
3518: if l_NoOfRecordsDel = 0 then
3526: -- the transaction is commited. This also creates a record in the
3527: -- Pa_Purge_Project_details which will show the no. of records
3528: -- that are purged from each table.
3529:
3530: pa_debug.debug( ' ->Calling pa_purge.CommitProcess ') ;
3531: pa_purge.CommitProcess
3532: (p_purge_batch_id => p_purge_batch_id,
3533: p_project_id => p_project_id,
3534: p_table_name => 'PA_DISTRIBUTION_WARNINGS',
3548: WHEN PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error then
3549: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
3550:
3551: WHEN OTHERS THEN
3552: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_DistWarnings' );
3553: pa_debug.debug('Error stage is '||x_err_stage );
3554: pa_debug.debug('Error stack is '||x_err_stack );
3555: pa_debug.debug(SQLERRM);
3556: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
3549: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
3550:
3551: WHEN OTHERS THEN
3552: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_DistWarnings' );
3553: pa_debug.debug('Error stage is '||x_err_stage );
3554: pa_debug.debug('Error stack is '||x_err_stack );
3555: pa_debug.debug(SQLERRM);
3556: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
3557:
3550:
3551: WHEN OTHERS THEN
3552: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_DistWarnings' );
3553: pa_debug.debug('Error stage is '||x_err_stage );
3554: pa_debug.debug('Error stack is '||x_err_stack );
3555: pa_debug.debug(SQLERRM);
3556: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
3557:
3558: /* ATG NOCOPY changes */
3551: WHEN OTHERS THEN
3552: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_DistWarnings' );
3553: pa_debug.debug('Error stage is '||x_err_stage );
3554: pa_debug.debug('Error stack is '||x_err_stack );
3555: pa_debug.debug(SQLERRM);
3556: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
3557:
3558: /* ATG NOCOPY changes */
3559: x_err_stack := l_old_err_stack ;
3591: l_old_err_stack := x_err_stack;
3592:
3593: x_err_stack := x_err_stack || ' ->Entering PA_BillingMessages' ;
3594:
3595: pa_debug.debug(x_err_stack);
3596:
3597: LOOP
3598: l_NoOfRecordsDel := 0; -- Value of l_NoOfRecordsDel is reset for BUg 4104133
3599: l_NoOfRecordsIns := 0; -- Value of l_NoOfRecordsIns is reset for BUg 4104133
3605: -- in the commit size.
3606:
3607: l_commit_size := pa_utils2.arpur_mrc_commit_size / 2 ;
3608:
3609: pa_debug.debug( ' ->Before insert into PA_Billing_Messages_AR') ;
3610: insert into PA_Billing_Messages_AR (
3611: PURGE_BATCH_ID,
3612: PURGE_RELEASE,
3613: PURGE_PROJECT_ID,
3688: /*Code Changes for Bug No.2984871 start */
3689: l_NoOfRecordsIns := SQL%ROWCOUNT ;
3690: /*Code Changes for Bug No.2984871 end */
3691:
3692: pa_debug.debug( ' ->After insert into pa_billing_messages_AR') ;
3693:
3694: /* Commented for Bug 2984871
3695: if SQL%ROWCOUNT > 0 then */
3696:
3701: -- selected because if archive option is selected the the records
3702: -- being purged will be those records which are already archived.
3703: -- table and
3704:
3705: pa_debug.debug( ' ->Before delete from pa_billing_messages ') ;
3706: /* commented and modified as below for performance reasons. Archive Purge 11.5
3707: delete from pa_billing_messages bm
3708: where (bm.rowid)
3709: in
3722: ) ;
3723: /*Code Changes for Bug No.2984871 start */
3724: l_NoOfRecordsDel := SQL%ROWCOUNT ;
3725: /*Code Changes for Bug No.2984871 end */
3726: pa_debug.debug( ' ->After delete from pa_billing_messages ') ;
3727:
3728: end if ;
3729: else
3730:
3732:
3733: -- If the archive option is not selected then the delete will
3734: -- be based on the commit size.
3735:
3736: pa_debug.debug( ' ->Before delete from pa_billing_messages ') ;
3737:
3738: /* commented and modified as below for performance reasons. Archive Purge 11.5
3739: delete from pa_billing_messages bm
3740: where (bm.rowid)
3751:
3752: /*Code Changes for Bug No.2984871 start */
3753: l_NoOfRecordsDel := SQL%ROWCOUNT ;
3754: /*Code Changes for Bug No.2984871 end */
3755: pa_debug.debug( ' ->After delete from pa_billing_messages ') ;
3756:
3757: end if ;
3758:
3759: if l_NoOfRecordsDel = 0 then
3767: -- the transaction is commited. This also creates a record in the
3768: -- Pa_Purge_Project_details which will show the no. of records
3769: -- that are purged from each table.
3770:
3771: pa_debug.debug( ' ->Calling pa_purge.CommitProcess ') ;
3772: pa_purge.CommitProcess
3773: (p_purge_batch_id => p_purge_batch_id,
3774: p_project_id => p_project_id,
3775: p_table_name => 'PA_BILLING_MESSAGES',
3789: WHEN PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error then
3790: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
3791:
3792: WHEN OTHERS THEN
3793: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_BillingMessages' );
3794: pa_debug.debug('Error stage is '||x_err_stage );
3795: pa_debug.debug('Error stack is '||x_err_stack );
3796: pa_debug.debug(SQLERRM);
3797: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
3790: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
3791:
3792: WHEN OTHERS THEN
3793: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_BillingMessages' );
3794: pa_debug.debug('Error stage is '||x_err_stage );
3795: pa_debug.debug('Error stack is '||x_err_stack );
3796: pa_debug.debug(SQLERRM);
3797: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
3798:
3791:
3792: WHEN OTHERS THEN
3793: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_BillingMessages' );
3794: pa_debug.debug('Error stage is '||x_err_stage );
3795: pa_debug.debug('Error stack is '||x_err_stack );
3796: pa_debug.debug(SQLERRM);
3797: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
3798:
3799: /* ATG NOCOPY changes */
3792: WHEN OTHERS THEN
3793: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_BillingMessages' );
3794: pa_debug.debug('Error stage is '||x_err_stage );
3795: pa_debug.debug('Error stack is '||x_err_stack );
3796: pa_debug.debug(SQLERRM);
3797: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
3798:
3799: /* ATG NOCOPY changes */
3800: x_err_stack := l_old_err_stack ;
3847: x_err_stack := x_err_stack || ' ->Before call to purge the data ';
3848:
3849: -- Call the procedures to archive/purge data for each billing table
3850: --
3851: pa_debug.debug('*-> About to purge CRDLs ') ;
3852: pa_purge_billing.PA_CustRevDistLines
3853: (p_purge_batch_id => p_purge_batch_id,
3854: p_project_id => p_project_id,
3855: p_txn_to_date => p_txn_to_date,
3860: x_err_stack => x_err_stack,
3861: x_err_stage => x_err_stage
3862: ) ;
3863:
3864: pa_debug.debug('*-> About to purge ERDLs ') ;
3865: pa_purge_billing.PA_EventRevDistLines
3866: (p_purge_batch_id => p_purge_batch_id,
3867: p_project_id => p_project_id,
3868: p_txn_to_date => p_txn_to_date,
3873: x_err_stack => x_err_stack,
3874: x_err_stage => x_err_stage
3875: ) ;
3876:
3877: pa_debug.debug('*-> About to purge Events ') ;
3878: pa_purge_billing.PA_Event
3879: (p_purge_batch_id => p_purge_batch_id,
3880: p_project_id => p_project_id,
3881: p_txn_to_date => p_txn_to_date,
3886: x_err_stack => x_err_stack,
3887: x_err_stage => x_err_stage
3888: ) ;
3889:
3890: pa_debug.debug('*-> About to purge Draft Revenue Items ') ;
3891: pa_purge_billing.PA_DraftRevItems
3892: (p_purge_batch_id => p_purge_batch_id,
3893: p_project_id => p_project_id,
3894: p_txn_to_date => p_txn_to_date,
3899: x_err_stack => x_err_stack,
3900: x_err_stage => x_err_stage
3901: ) ;
3902:
3903: pa_debug.debug('*-> About to purge Draft Invoice Items ') ;
3904: pa_purge_billing.PA_DraftInvItems
3905: (p_purge_batch_id => p_purge_batch_id,
3906: p_project_id => p_project_id,
3907: p_txn_to_date => p_txn_to_date,
3912: x_err_stack => x_err_stack,
3913: x_err_stage => x_err_stage
3914: ) ;
3915:
3916: pa_debug.debug('*-> About to purge Draft Revenues ') ;
3917: pa_purge_billing.PA_DraftRevenues
3918: (p_purge_batch_id => p_purge_batch_id,
3919: p_project_id => p_project_id,
3920: p_txn_to_date => p_txn_to_date,
3925: x_err_stack => x_err_stack,
3926: x_err_stage => x_err_stage
3927: ) ;
3928:
3929: pa_debug.debug('*-> About to purge Draft Invoices ') ;
3930: pa_purge_billing.PA_DraftInvoices
3931: (p_purge_batch_id => p_purge_batch_id,
3932: p_project_id => p_project_id,
3933: p_txn_to_date => p_txn_to_date,
3938: x_err_stack => x_err_stack,
3939: x_err_stage => x_err_stage
3940: ) ;
3941:
3942: pa_debug.debug('*-> About to purge distribution warnings ');
3943: pa_purge_billing.PA_DistWarnings
3944: (p_purge_batch_id => p_purge_batch_id,
3945: p_project_id => p_project_id,
3946: p_txn_to_date => p_txn_to_date,
3951: x_err_stack => x_err_stack,
3952: x_err_stage => x_err_stage
3953: ) ;
3954:
3955: pa_debug.debug('*-> About to purge billing messages ');
3956: pa_purge_billing.PA_BillingMessages
3957: (p_purge_batch_id => p_purge_batch_id,
3958: p_project_id => p_project_id,
3959: p_txn_to_date => p_txn_to_date,
3964: x_err_stack => x_err_stack,
3965: x_err_stage => x_err_stage
3966: ) ;
3967:
3968: pa_debug.debug('*-> About to purge retention details ');
3969: pa_purge_billing.PA_RetnInvDetails
3970: ( p_purge_batch_id => p_purge_batch_id,
3971: p_project_id => p_project_id,
3972: p_txn_to_date => p_txn_to_date,
3984: WHEN PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error then
3985: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
3986:
3987: WHEN OTHERS THEN
3988: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.pa_billing_main_purge' );
3989: pa_debug.debug('Error stage is '||x_err_stage );
3990: pa_debug.debug('Error stack is '||x_err_stack );
3991: pa_debug.debug(SQLERRM);
3992: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
3985: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
3986:
3987: WHEN OTHERS THEN
3988: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.pa_billing_main_purge' );
3989: pa_debug.debug('Error stage is '||x_err_stage );
3990: pa_debug.debug('Error stack is '||x_err_stack );
3991: pa_debug.debug(SQLERRM);
3992: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
3993:
3986:
3987: WHEN OTHERS THEN
3988: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.pa_billing_main_purge' );
3989: pa_debug.debug('Error stage is '||x_err_stage );
3990: pa_debug.debug('Error stack is '||x_err_stack );
3991: pa_debug.debug(SQLERRM);
3992: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
3993:
3994: /* ATG NOCOPY changes */
3987: WHEN OTHERS THEN
3988: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.pa_billing_main_purge' );
3989: pa_debug.debug('Error stage is '||x_err_stage );
3990: pa_debug.debug('Error stack is '||x_err_stack );
3991: pa_debug.debug(SQLERRM);
3992: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
3993:
3994: /* ATG NOCOPY changes */
3995: x_err_stack := l_old_err_stack;