9: PROCEDURE Cleanup_Line_Data
10: AS
11: BEGIN
12:
13: IF (BIS_COLLECTION_UTILITIES.g_debug) THEN
14: BIS_COLLECTION_UTILITIES.Debug('Start deleting the updated rows from ' ||
15: 'ASO_BI_QUOTE_LINES_ALL table');
16: END IF;
17:
10: AS
11: BEGIN
12:
13: IF (BIS_COLLECTION_UTILITIES.g_debug) THEN
14: BIS_COLLECTION_UTILITIES.Debug('Start deleting the updated rows from ' ||
15: 'ASO_BI_QUOTE_LINES_ALL table');
16: END IF;
17:
18: DELETE FROM ASO_BI_QUOTE_LINES_ALL qlin
20: SELECT quote_number
21: FROM ASO_BI_QUOTE_IDS
22: );
23:
24: IF (BIS_COLLECTION_UTILITIES.g_debug) THEN
25: BIS_COLLECTION_UTILITIES.Debug('Deleted the updated rows from '||
26: 'ASO_BI_QUOTE_LINES_ALL table');
27: END IF;
28:
21: FROM ASO_BI_QUOTE_IDS
22: );
23:
24: IF (BIS_COLLECTION_UTILITIES.g_debug) THEN
25: BIS_COLLECTION_UTILITIES.Debug('Deleted the updated rows from '||
26: 'ASO_BI_QUOTE_LINES_ALL table');
27: END IF;
28:
29: COMMIT;
56: FROM ASO_QUOTE_LINES_ALL qlin,
57: ASO_BI_QUOTE_IDS qid
58: WHERE qid.quote_header_id = qlin.quote_header_id;
59:
60: IF (BIS_COLLECTION_UTILITIES.g_debug) THEN
61: BIS_COLLECTION_UTILITIES.Debug('Inserted '||SQL%ROWCOUNT||' rows in ' ||
62: 'ASO_BI_LINE_IDS.');
63: END IF;
64:
57: ASO_BI_QUOTE_IDS qid
58: WHERE qid.quote_header_id = qlin.quote_header_id;
59:
60: IF (BIS_COLLECTION_UTILITIES.g_debug) THEN
61: BIS_COLLECTION_UTILITIES.Debug('Inserted '||SQL%ROWCOUNT||' rows in ' ||
62: 'ASO_BI_LINE_IDS.');
63: END IF;
64:
65: COMMIT;
77: /* For Transactions with Average Complexity */
78: l_batch_size:= bis_common_parameters.get_batch_size(
79: BIS_COMMON_PARAMETERS.MEDIUM);
80:
81: IF (BIS_COLLECTION_UTILITIES.g_debug) THEN
82: BIS_COLLECTION_UTILITIES.Debug('Started populating ASO_BI_LINE_IDS table');
83: END IF;
84:
85: INSERT INTO ASO_BI_LINE_IDS
78: l_batch_size:= bis_common_parameters.get_batch_size(
79: BIS_COMMON_PARAMETERS.MEDIUM);
80:
81: IF (BIS_COLLECTION_UTILITIES.g_debug) THEN
82: BIS_COLLECTION_UTILITIES.Debug('Started populating ASO_BI_LINE_IDS table');
83: END IF;
84:
85: INSERT INTO ASO_BI_LINE_IDS
86: ( QUOTE_HEADER_ID,
99: FROM ASO_QUOTE_LINES_ALL qlin,
100: ASO_BI_QUOTE_IDS qid
101: WHERE qid.quote_header_id = qlin.quote_header_id;
102:
103: IF (BIS_COLLECTION_UTILITIES.g_debug) THEN
104: BIS_COLLECTION_UTILITIES.Debug('Inserted '||SQL%ROWCOUNT||' rows in ' ||
105: 'ASO_BI_QUOTE_IDS.');
106: END IF;
107:
100: ASO_BI_QUOTE_IDS qid
101: WHERE qid.quote_header_id = qlin.quote_header_id;
102:
103: IF (BIS_COLLECTION_UTILITIES.g_debug) THEN
104: BIS_COLLECTION_UTILITIES.Debug('Inserted '||SQL%ROWCOUNT||' rows in ' ||
105: 'ASO_BI_QUOTE_IDS.');
106: END IF;
107:
108: COMMIT;
122: SELECT DISTINCT batch_id, 0, 'UNASSIGNED'
123: FROM ASO_BI_LINE_IDS ;
124: COMMIT;
125:
126: IF (BIS_COLLECTION_UTILITIES.g_debug) THEN
127: BIS_COLLECTION_UTILITIES.Debug('Inserted '||SQL%ROWCOUNT||' jobs into '||
128: 'ASO_BI_QUOTE_FACT_JOBS');
129: END IF;
130:
123: FROM ASO_BI_LINE_IDS ;
124: COMMIT;
125:
126: IF (BIS_COLLECTION_UTILITIES.g_debug) THEN
127: BIS_COLLECTION_UTILITIES.Debug('Inserted '||SQL%ROWCOUNT||' jobs into '||
128: 'ASO_BI_QUOTE_FACT_JOBS');
129: END IF;
130:
131: END Register_Line_jobs;
136: l_rpt_curr varchar2(50);
137: l_sec_currency varchar2(50);
138: Begin
139:
140: IF (BIS_COLLECTION_UTILITIES.g_debug) THEN
141: BIS_COLLECTION_UTILITIES.Debug('populating the Quote Lines Staging');
142: END IF;
143:
144: l_rate_type := bis_common_parameters.get_rate_type;
137: l_sec_currency varchar2(50);
138: Begin
139:
140: IF (BIS_COLLECTION_UTILITIES.g_debug) THEN
141: BIS_COLLECTION_UTILITIES.Debug('populating the Quote Lines Staging');
142: END IF;
143:
144: l_rate_type := bis_common_parameters.get_rate_type;
145: l_rpt_curr := bis_common_parameters.get_currency_code;
255: AND qlin.quote_line_id = linid.quote_line_id
256: AND qhd.cust_account_id = hzcst.CUST_ACCOUNT_ID(+)
257: AND QHD.Order_id = ord.header_id(+);
258:
259: IF (BIS_COLLECTION_UTILITIES.g_debug) THEN
260: BIS_COLLECTION_UTILITIES.Debug('Done populating the Quote Line Staging:'||
261: 'Rowcount:'|| SQL%ROWCOUNT);
262: END IF;
263:
256: AND qhd.cust_account_id = hzcst.CUST_ACCOUNT_ID(+)
257: AND QHD.Order_id = ord.header_id(+);
258:
259: IF (BIS_COLLECTION_UTILITIES.g_debug) THEN
260: BIS_COLLECTION_UTILITIES.Debug('Done populating the Quote Line Staging:'||
261: 'Rowcount:'|| SQL%ROWCOUNT);
262: END IF;
263:
264: COMMIT;
276: l_rpt_curr varchar2(50);
277: l_sec_currency varchar2(50);
278: BEGIN
279:
280: IF (BIS_COLLECTION_UTILITIES.g_debug) THEN
281: BIS_COLLECTION_UTILITIES.Debug('Stared populating the Quote line fact Staging');
282: END IF;
283:
284: l_rate_type := bis_common_parameters.get_rate_type;
277: l_sec_currency varchar2(50);
278: BEGIN
279:
280: IF (BIS_COLLECTION_UTILITIES.g_debug) THEN
281: BIS_COLLECTION_UTILITIES.Debug('Stared populating the Quote line fact Staging');
282: END IF;
283:
284: l_rate_type := bis_common_parameters.get_rate_type;
285: l_rpt_curr := bis_common_parameters.get_currency_code;
390: AND qhd.cust_account_id = hzcst.CUST_ACCOUNT_ID(+)
391: AND qhd.Order_id = ord.header_id(+)
392: AND linid.batch_id = p_batch_id;
393:
394: IF (BIS_COLLECTION_UTILITIES.g_debug) THEN
395: BIS_COLLECTION_UTILITIES.Debug('Done populating the Quote line fact '||
396: 'Staging:Rowcount: '||SQL%ROWCOUNT);
397: END IF;
398:
391: AND qhd.Order_id = ord.header_id(+)
392: AND linid.batch_id = p_batch_id;
393:
394: IF (BIS_COLLECTION_UTILITIES.g_debug) THEN
395: BIS_COLLECTION_UTILITIES.Debug('Done populating the Quote line fact '||
396: 'Staging:Rowcount: '||SQL%ROWCOUNT);
397: END IF;
398:
399: COMMIT;
414: l_user_id := FND_GLOBAL.user_id;
415: l_login_id := FND_GLOBAL.login_id;
416: l_sysdate := sysdate;
417:
418: IF (BIS_COLLECTION_UTILITIES.g_debug) THEN
419: BIS_COLLECTION_UTILITIES.Debug('Start populating the Quote Line fact');
420: END IF;
421:
422: EXECUTE IMMEDIATE
415: l_login_id := FND_GLOBAL.login_id;
416: l_sysdate := sysdate;
417:
418: IF (BIS_COLLECTION_UTILITIES.g_debug) THEN
419: BIS_COLLECTION_UTILITIES.Debug('Start populating the Quote Line fact');
420: END IF;
421:
422: EXECUTE IMMEDIATE
423: 'INSERT/*+ APPEND PARALLEL(QOT_LINES_ALL)*/
642: l_sysdate,
643: l_user_id,
644: l_login_id;
645:
646: IF (BIS_COLLECTION_UTILITIES.g_debug) THEN
647: BIS_COLLECTION_UTILITIES.Debug('Done populating the Quote Line fact'||
648: ':Rowcount:'||SQL%ROWCOUNT);
649: END IF;
650:
643: l_user_id,
644: l_login_id;
645:
646: IF (BIS_COLLECTION_UTILITIES.g_debug) THEN
647: BIS_COLLECTION_UTILITIES.Debug('Done populating the Quote Line fact'||
648: ':Rowcount:'||SQL%ROWCOUNT);
649: END IF;
650:
651: COMMIT;
664: l_user_id := FND_GLOBAL.user_id;
665: l_login_id := FND_GLOBAL.login_id;
666: l_sysdate := sysdate;
667:
668: IF (BIS_COLLECTION_UTILITIES.g_debug) THEN
669: BIS_COLLECTION_UTILITIES.Debug('Start populating the Quote Line fact');
670: END IF;
671:
672: EXECUTE IMMEDIATE
665: l_login_id := FND_GLOBAL.login_id;
666: l_sysdate := sysdate;
667:
668: IF (BIS_COLLECTION_UTILITIES.g_debug) THEN
669: BIS_COLLECTION_UTILITIES.Debug('Start populating the Quote Line fact');
670: END IF;
671:
672: EXECUTE IMMEDIATE
673: 'INSERT/*+ append */ INTO ASO_BI_QUOTE_LINES_ALL
892: l_sysdate,
893: l_user_id,
894: l_login_id;
895:
896: IF (BIS_COLLECTION_UTILITIES.g_debug) THEN
897: BIS_COLLECTION_UTILITIES.Debug('Done populating the Quote line fact '||
898: 'Staging:Rowcount: '||SQL%ROWCOUNT);
899: END IF;
900:
893: l_user_id,
894: l_login_id;
895:
896: IF (BIS_COLLECTION_UTILITIES.g_debug) THEN
897: BIS_COLLECTION_UTILITIES.Debug('Done populating the Quote line fact '||
898: 'Staging:Rowcount: '||SQL%ROWCOUNT);
899: END IF;
900:
901: COMMIT;
920: BEGIN
921: errbuf := NULL;
922: retcode := 0;
923:
924: IF(BIS_COLLECTION_UTILITIES.Setup(
925: p_object_name => 'ASO_BI_QOT_LINE_SUBWORKER'||p_worker_no)) = false
926: THEN
927: errbuf := FND_MESSAGE.Get;
928: RAISE_APPLICATION_ERROR(-20000,errbuf);
927: errbuf := FND_MESSAGE.Get;
928: RAISE_APPLICATION_ERROR(-20000,errbuf);
929: END IF;
930:
931: IF (BIS_COLLECTION_UTILITIES.g_debug) THEN
932: BIS_COLLECTION_UTILITIES.Debug('ASO_BI_QOT_LINE_SUBWORKER'||p_worker_no||
933: ' starting.');
934: END IF;
935:
928: RAISE_APPLICATION_ERROR(-20000,errbuf);
929: END IF;
930:
931: IF (BIS_COLLECTION_UTILITIES.g_debug) THEN
932: BIS_COLLECTION_UTILITIES.Debug('ASO_BI_QOT_LINE_SUBWORKER'||p_worker_no||
933: ' starting.');
934: END IF;
935:
936: -- This call is to populate functional currency again
950: l_total_cnt
951: FROM ASO_BI_QUOTE_FACT_JOBS;
952:
953: IF(l_failed_cnt > 0) Then
954: IF (BIS_COLLECTION_UTILITIES.g_debug) THEN
955: BIS_COLLECTION_UTILITIES.Debug('Another worker have errored out.'||
956: ' Stop Processing.');
957: END IF;
958: Exit;
951: FROM ASO_BI_QUOTE_FACT_JOBS;
952:
953: IF(l_failed_cnt > 0) Then
954: IF (BIS_COLLECTION_UTILITIES.g_debug) THEN
955: BIS_COLLECTION_UTILITIES.Debug('Another worker have errored out.'||
956: ' Stop Processing.');
957: END IF;
958: Exit;
959: Elsif (l_unassigned_cnt = 0) Then
956: ' Stop Processing.');
957: END IF;
958: Exit;
959: Elsif (l_unassigned_cnt = 0) Then
960: IF (BIS_COLLECTION_UTILITIES.g_debug) THEN
961: BIS_COLLECTION_UTILITIES.Debug('No More jobs left.Terminating.');
962: END IF;
963: EXIT;
964: Elsif( l_comp_cnt = l_total_cnt) Then
957: END IF;
958: Exit;
959: Elsif (l_unassigned_cnt = 0) Then
960: IF (BIS_COLLECTION_UTILITIES.g_debug) THEN
961: BIS_COLLECTION_UTILITIES.Debug('No More jobs left.Terminating.');
962: END IF;
963: EXIT;
964: Elsif( l_comp_cnt = l_total_cnt) Then
965: IF (BIS_COLLECTION_UTILITIES.g_debug) THEN
961: BIS_COLLECTION_UTILITIES.Debug('No More jobs left.Terminating.');
962: END IF;
963: EXIT;
964: Elsif( l_comp_cnt = l_total_cnt) Then
965: IF (BIS_COLLECTION_UTILITIES.g_debug) THEN
966: BIS_COLLECTION_UTILITIES.Debug('All Jobs completed.Terminating.');
967: END IF;
968: EXIT;
969: Elsif(l_unassigned_cnt > 0) Then
962: END IF;
963: EXIT;
964: Elsif( l_comp_cnt = l_total_cnt) Then
965: IF (BIS_COLLECTION_UTILITIES.g_debug) THEN
966: BIS_COLLECTION_UTILITIES.Debug('All Jobs completed.Terminating.');
967: END IF;
968: EXIT;
969: Elsif(l_unassigned_cnt > 0) Then
970: UPDATE ASO_BI_QUOTE_FACT_JOBS
983: FROM ASO_BI_QUOTE_FACT_JOBS
984: WHERE worker_number = p_worker_no
985: AND status = 'IN_PROCESS';
986:
987: IF (BIS_COLLECTION_UTILITIES.g_debug) THEN
988: BIS_COLLECTION_UTILITIES.Debug('Start populate line Staging:'||
989: TO_CHAR(SYSDATE,'MM/DD/YYYY HH24:MI:SS'));
990: END IF;
991:
984: WHERE worker_number = p_worker_no
985: AND status = 'IN_PROCESS';
986:
987: IF (BIS_COLLECTION_UTILITIES.g_debug) THEN
988: BIS_COLLECTION_UTILITIES.Debug('Start populate line Staging:'||
989: TO_CHAR(SYSDATE,'MM/DD/YYYY HH24:MI:SS'));
990: END IF;
991:
992: POPULATE_QOT_LINE_FACT_STG(p_batch_id => l_batch_id);
990: END IF;
991:
992: POPULATE_QOT_LINE_FACT_STG(p_batch_id => l_batch_id);
993:
994: IF (BIS_COLLECTION_UTILITIES.g_debug) THEN
995: BIS_COLLECTION_UTILITIES.Debug('End populate line Staging:'||
996: TO_CHAR(SYSDATE,'MM/DD/YYYY HH24:MI:SS'));
997: END IF;
998:
991:
992: POPULATE_QOT_LINE_FACT_STG(p_batch_id => l_batch_id);
993:
994: IF (BIS_COLLECTION_UTILITIES.g_debug) THEN
995: BIS_COLLECTION_UTILITIES.Debug('End populate line Staging:'||
996: TO_CHAR(SYSDATE,'MM/DD/YYYY HH24:MI:SS'));
997: END IF;
998:
999: UPDATE ASO_BI_QUOTE_FACT_JOBS