77: l_currency VARCHAR2(3200) ; -- Currency
78: l_prod_catg VARCHAR2(3200) ; -- Product Category
79: l_prod VARCHAR2(3200) ; -- Product
80:
81: --FND Logging
82: l_full_path VARCHAR2(50) ;
83: gaflog_value VARCHAR2(10) ;
84: --Profile is : FND: Debug Log Enabled and FND: Debug Log Level for Log Level
85: BEGIN
84: --Profile is : FND: Debug Log Enabled and FND: Debug Log Level for Log Level
85: BEGIN
86:
87: --Fetch all the Parameters into the Local Variables.
88: l_full_path := 'ibw.plsql.ibwrepab.page_int_nontrend_sql'; --This would be stored in FND_LOG_MESSAGES.MODULE column
89: gaflog_value := fnd_profile.value('AFLOG_ENABLED'); --Profile is : FND: Debug Log Enabled and FND: Debug Log Level for Log Level
90:
91: IF gaflog_value ='Y' AND (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
92: fnd_log.string(fnd_log.level_statement,l_full_path,'begin');
87: --Fetch all the Parameters into the Local Variables.
88: l_full_path := 'ibw.plsql.ibwrepab.page_int_nontrend_sql'; --This would be stored in FND_LOG_MESSAGES.MODULE column
89: gaflog_value := fnd_profile.value('AFLOG_ENABLED'); --Profile is : FND: Debug Log Enabled and FND: Debug Log Level for Log Level
90:
91: IF gaflog_value ='Y' AND (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
92: fnd_log.string(fnd_log.level_statement,l_full_path,'begin');
93: END IF;
94:
95: IF gaflog_value ='Y' AND (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
88: l_full_path := 'ibw.plsql.ibwrepab.page_int_nontrend_sql'; --This would be stored in FND_LOG_MESSAGES.MODULE column
89: gaflog_value := fnd_profile.value('AFLOG_ENABLED'); --Profile is : FND: Debug Log Enabled and FND: Debug Log Level for Log Level
90:
91: IF gaflog_value ='Y' AND (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
92: fnd_log.string(fnd_log.level_statement,l_full_path,'begin');
93: END IF;
94:
95: IF gaflog_value ='Y' AND (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
96: fnd_log.string(fnd_log.level_procedure,l_full_path,'Before the Call to UTL Package');
91: IF gaflog_value ='Y' AND (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
92: fnd_log.string(fnd_log.level_statement,l_full_path,'begin');
93: END IF;
94:
95: IF gaflog_value ='Y' AND (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
96: fnd_log.string(fnd_log.level_procedure,l_full_path,'Before the Call to UTL Package');
97: END IF;
98:
99: --To get all the Page Parameters.
92: fnd_log.string(fnd_log.level_statement,l_full_path,'begin');
93: END IF;
94:
95: IF gaflog_value ='Y' AND (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
96: fnd_log.string(fnd_log.level_procedure,l_full_path,'Before the Call to UTL Package');
97: END IF;
98:
99: --To get all the Page Parameters.
100: IBW_BI_UTL_PVT.GET_PAGE_PARAMETERS
113: , x_campaign => l_campaign --Not Used
114: , x_view_by => l_view_by --Either Site Area or Page
115: );
116:
117: IF gaflog_value ='Y' AND (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
118: fnd_log.string(fnd_log.level_procedure,l_full_path,'After the Call to UTL Package');
119: END IF;
120:
121: IF gaflog_value ='Y' AND (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
114: , x_view_by => l_view_by --Either Site Area or Page
115: );
116:
117: IF gaflog_value ='Y' AND (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
118: fnd_log.string(fnd_log.level_procedure,l_full_path,'After the Call to UTL Package');
119: END IF;
120:
121: IF gaflog_value ='Y' AND (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
122: fnd_log.string(fnd_log.level_statement,l_full_path,'l_site : ' || l_site ||' l_site_area : '|| l_site_area ||' l_page : '|| l_page || ' l_view_by : ' || l_view_by );
117: IF gaflog_value ='Y' AND (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
118: fnd_log.string(fnd_log.level_procedure,l_full_path,'After the Call to UTL Package');
119: END IF;
120:
121: IF gaflog_value ='Y' AND (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
122: fnd_log.string(fnd_log.level_statement,l_full_path,'l_site : ' || l_site ||' l_site_area : '|| l_site_area ||' l_page : '|| l_page || ' l_view_by : ' || l_view_by );
123: END IF;
124:
125: --Initializing all the values to Null.
118: fnd_log.string(fnd_log.level_procedure,l_full_path,'After the Call to UTL Package');
119: END IF;
120:
121: IF gaflog_value ='Y' AND (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
122: fnd_log.string(fnd_log.level_statement,l_full_path,'l_site : ' || l_site ||' l_site_area : '|| l_site_area ||' l_page : '|| l_page || ' l_view_by : ' || l_view_by );
123: END IF;
124:
125: --Initializing all the values to Null.
126: l_custom_sql := '';
199: ' , SUM(nvl(page_views,0)) OVER() IBW_G_TOT1 ' ||
200: ' , DECODE(SUM(nvl(page_views,0)) OVER(),0,NULL,(SUM(PAGE_VIEW_DURATION) OVER()/ SUM(PAGE_VIEWS) OVER() )) IBW_G_TOT2 ' ;
201:
202:
203: IF gaflog_value ='Y' AND (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
204: fnd_log.string(fnd_log.level_statement,l_full_path,'After Outer Select ');
205: END IF;
206:
207: l_middle_select := 'inner1.*'||
200: ' , DECODE(SUM(nvl(page_views,0)) OVER(),0,NULL,(SUM(PAGE_VIEW_DURATION) OVER()/ SUM(PAGE_VIEWS) OVER() )) IBW_G_TOT2 ' ;
201:
202:
203: IF gaflog_value ='Y' AND (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
204: fnd_log.string(fnd_log.level_statement,l_full_path,'After Outer Select ');
205: END IF;
206:
207: l_middle_select := 'inner1.*'||
208: ',inner2.daily_unique_visitor_gt daily_unique_visitor_gt'||
224: ' OR COUNT(DISTINCT(visitant_id)) > 0 ' ||
225: ' OR COUNT(DISTINCT(visit_id)) > 0 ' ;
226:
227:
228: IF gaflog_value ='Y' AND (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
229: fnd_log.string(fnd_log.level_statement,l_full_path,'After Inner Select ');
230: END IF;
231:
232: --The From Clause is recorded in this variable
225: ' OR COUNT(DISTINCT(visit_id)) > 0 ' ;
226:
227:
228: IF gaflog_value ='Y' AND (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
229: fnd_log.string(fnd_log.level_statement,l_full_path,'After Inner Select ');
230: END IF;
231:
232: --The From Clause is recorded in this variable
233: --The MV : IBW_PAGE_SA_TIME_MV is the Top Level MV built for Page Interest Reports
237: ' FII_TIME_RPT_STRUCT_V CAL, ' ;
238:
239:
240:
241: IF gaflog_value ='Y' AND (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
242: fnd_log.string(fnd_log.level_statement,l_full_path,'After Initial From Clause ' );
243: END IF;
244:
245: --The Where Clause is recorded in this variable.
238:
239:
240:
241: IF gaflog_value ='Y' AND (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
242: fnd_log.string(fnd_log.level_statement,l_full_path,'After Initial From Clause ' );
243: END IF;
244:
245: --The Where Clause is recorded in this variable.
246: --This Where clause will have all the Basic Conditions to join between the PAGE_SA_MV and the Time Dimension table
256:
257:
258:
259:
260: IF gaflog_value ='Y' AND (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
261: fnd_log.string(fnd_log.level_statement,l_full_path,'After Initial Where Clause ' );
262: END IF;
263:
264: --This is to Assign respective grouping id for each of the view bys so that the appropriate records are picked up.
257:
258:
259:
260: IF gaflog_value ='Y' AND (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
261: fnd_log.string(fnd_log.level_statement,l_full_path,'After Initial Where Clause ' );
262: END IF;
263:
264: --This is to Assign respective grouping id for each of the view bys so that the appropriate records are picked up.
265: IF l_view_by = 'IBW_PAGE+IBW_PAGES' THEN
363:
364:
365:
366:
367: IF gaflog_value ='Y' AND (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
368: fnd_log.string(fnd_log.level_statement,l_full_path,'The value of l_grouping_id ' || l_grouping_id );
369: END IF;
370:
371: --Fetching Site Area Name or Page Name according to the View by
364:
365:
366:
367: IF gaflog_value ='Y' AND (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
368: fnd_log.string(fnd_log.level_statement,l_full_path,'The value of l_grouping_id ' || l_grouping_id );
369: END IF;
370:
371: --Fetching Site Area Name or Page Name according to the View by
372:
463: l_outer_select :=l_outer_select||' , DAILY_UN_VISITORS IBW_G_TOT3, VISITS IBW_G_TOT4 ';
464: END IF;
465:
466:
467: IF gaflog_value ='Y' AND (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
468: fnd_log.string(fnd_log.level_statement,l_full_path,'After View by Comparisons ' );
469: END IF;
470:
471: --------------------------------------------------------------------------------------------------------------
464: END IF;
465:
466:
467: IF gaflog_value ='Y' AND (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
468: fnd_log.string(fnd_log.level_statement,l_full_path,'After View by Comparisons ' );
469: END IF;
470:
471: --------------------------------------------------------------------------------------------------------------
472: --Site Id Validation
485: END IF; --End if for l_site
486: --------------------------------------------------------------------------------------------------------------
487: --Validation of values if selected in Page and Site Area Dimension.
488:
489: IF gaflog_value ='Y' AND (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
490: fnd_log.string(fnd_log.level_statement,l_full_path,'After Site Id Validations ' );
491: END IF;
492:
493: IF upper(l_page ) ='ALL' THEN
486: --------------------------------------------------------------------------------------------------------------
487: --Validation of values if selected in Page and Site Area Dimension.
488:
489: IF gaflog_value ='Y' AND (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
490: fnd_log.string(fnd_log.level_statement,l_full_path,'After Site Id Validations ' );
491: END IF;
492:
493: IF upper(l_page ) ='ALL' THEN
494: IF UPPER(l_site_area) <> 'ALL' THEN
583:
584:
585:
586: --For Debug Purpose
587: IF gaflog_value ='Y' AND (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
588: fnd_log.string(fnd_log.level_statement,l_full_path,'The Final Query is ' || l_custom_sql);
589: END IF;
590:
591: x_custom_sql := l_custom_sql; --This sql is returned back to the PMV.
584:
585:
586: --For Debug Purpose
587: IF gaflog_value ='Y' AND (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
588: fnd_log.string(fnd_log.level_statement,l_full_path,'The Final Query is ' || l_custom_sql);
589: END IF;
590:
591: x_custom_sql := l_custom_sql; --This sql is returned back to the PMV.
592:
609: x_custom_output.EXTEND;
610: x_custom_output(2) := l_custom_rec;
611:
612:
613: IF gaflog_value ='Y' AND (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
614: fnd_log.string(fnd_log.level_statement,l_full_path,'END');
615: END IF;
616:
617: EXCEPTION
610: x_custom_output(2) := l_custom_rec;
611:
612:
613: IF gaflog_value ='Y' AND (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
614: fnd_log.string(fnd_log.level_statement,l_full_path,'END');
615: END IF;
616:
617: EXCEPTION
618: WHEN OTHERS THEN
615: END IF;
616:
617: EXCEPTION
618: WHEN OTHERS THEN
619: if (fnd_log.level_unexpected >= fnd_log.g_current_runtime_level) then
620: fnd_log.string(fnd_log.level_unexpected,l_full_path,SQLERRM);
621: end if;
622: END get_page_int_sql;
623:
616:
617: EXCEPTION
618: WHEN OTHERS THEN
619: if (fnd_log.level_unexpected >= fnd_log.g_current_runtime_level) then
620: fnd_log.string(fnd_log.level_unexpected,l_full_path,SQLERRM);
621: end if;
622: END get_page_int_sql;
623:
624: /**********************************************************************************************
661: l_currency VARCHAR2(3200) ; -- Currency
662: l_prod_catg VARCHAR2(3200) ; -- Product Category
663: l_prod VARCHAR2(3200) ; -- Product
664:
665: --FND Logging
666: l_full_path VARCHAR2(50);
667: gaflog_value VARCHAR2(10);
668: BEGIN
669:
667: gaflog_value VARCHAR2(10);
668: BEGIN
669:
670: --Profiles for FND Debugging are : FND: Log Enabled , FND: Log Level
671: l_full_path := 'ibw.plsql.ibwrepab.page_int_nontrend_sql'; --This would be stored in FND_LOG_MESSAGES.MODULE column
672: gaflog_value := fnd_profile.value('AFLOG_ENABLED');
673:
674: IF gaflog_value ='Y' AND (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
675: fnd_log.string(fnd_log.level_statement,l_full_path,'Begin');
670: --Profiles for FND Debugging are : FND: Log Enabled , FND: Log Level
671: l_full_path := 'ibw.plsql.ibwrepab.page_int_nontrend_sql'; --This would be stored in FND_LOG_MESSAGES.MODULE column
672: gaflog_value := fnd_profile.value('AFLOG_ENABLED');
673:
674: IF gaflog_value ='Y' AND (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
675: fnd_log.string(fnd_log.level_statement,l_full_path,'Begin');
676: END IF;
677:
678: IF gaflog_value ='Y' AND (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
671: l_full_path := 'ibw.plsql.ibwrepab.page_int_nontrend_sql'; --This would be stored in FND_LOG_MESSAGES.MODULE column
672: gaflog_value := fnd_profile.value('AFLOG_ENABLED');
673:
674: IF gaflog_value ='Y' AND (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
675: fnd_log.string(fnd_log.level_statement,l_full_path,'Begin');
676: END IF;
677:
678: IF gaflog_value ='Y' AND (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
679: fnd_log.string(fnd_log.level_procedure,l_full_path,'Before the Call to UTL Package');
674: IF gaflog_value ='Y' AND (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
675: fnd_log.string(fnd_log.level_statement,l_full_path,'Begin');
676: END IF;
677:
678: IF gaflog_value ='Y' AND (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
679: fnd_log.string(fnd_log.level_procedure,l_full_path,'Before the Call to UTL Package');
680: END IF;
681:
682: --To get all the Page Parameters.
675: fnd_log.string(fnd_log.level_statement,l_full_path,'Begin');
676: END IF;
677:
678: IF gaflog_value ='Y' AND (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
679: fnd_log.string(fnd_log.level_procedure,l_full_path,'Before the Call to UTL Package');
680: END IF;
681:
682: --To get all the Page Parameters.
683: IBW_BI_UTL_PVT.GET_PAGE_PARAMETERS
696: , x_campaign => l_campaign --Not Used
697: , x_view_by => l_view_by --Not Used
698: );
699:
700: IF gaflog_value ='Y' AND (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
701: fnd_log.string(fnd_log.level_procedure,l_full_path,'After the Call to UTL Package');
702: END IF;
703:
704: IF gaflog_value ='Y' AND (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
697: , x_view_by => l_view_by --Not Used
698: );
699:
700: IF gaflog_value ='Y' AND (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
701: fnd_log.string(fnd_log.level_procedure,l_full_path,'After the Call to UTL Package');
702: END IF;
703:
704: IF gaflog_value ='Y' AND (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
705: fnd_log.string(fnd_log.level_statement,l_full_path,'l_site : ' || l_site ||' l_site_area : '|| l_site_area ||' l_page : '|| l_page );
700: IF gaflog_value ='Y' AND (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
701: fnd_log.string(fnd_log.level_procedure,l_full_path,'After the Call to UTL Package');
702: END IF;
703:
704: IF gaflog_value ='Y' AND (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
705: fnd_log.string(fnd_log.level_statement,l_full_path,'l_site : ' || l_site ||' l_site_area : '|| l_site_area ||' l_page : '|| l_page );
706: END IF;
707:
708: --Initializing the variables to Null
701: fnd_log.string(fnd_log.level_procedure,l_full_path,'After the Call to UTL Package');
702: END IF;
703:
704: IF gaflog_value ='Y' AND (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
705: fnd_log.string(fnd_log.level_statement,l_full_path,'l_site : ' || l_site ||' l_site_area : '|| l_site_area ||' l_page : '|| l_page );
706: END IF;
707:
708: --Initializing the variables to Null
709: l_from := '';
983:
984:
985:
986:
987: IF gaflog_value ='Y' AND (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
988: fnd_log.string(fnd_log.level_statement,l_full_path,'l_custom_sql : ' || l_custom_sql);
989: END IF;
990:
991: x_custom_sql := l_custom_sql;
984:
985:
986:
987: IF gaflog_value ='Y' AND (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
988: fnd_log.string(fnd_log.level_statement,l_full_path,'l_custom_sql : ' || l_custom_sql);
989: END IF;
990:
991: x_custom_sql := l_custom_sql;
992:
994: x_custom_output := BIS_QUERY_ATTRIBUTES_TBL();
995:
996: EXCEPTION
997: WHEN OTHERS THEN
998: if (fnd_log.level_unexpected >= fnd_log.g_current_runtime_level) then
999: fnd_log.string(fnd_log.level_unexpected,l_full_path,SQLERRM);
1000: end if;
1001:
1002: END get_page_int_trend_sql;
995:
996: EXCEPTION
997: WHEN OTHERS THEN
998: if (fnd_log.level_unexpected >= fnd_log.g_current_runtime_level) then
999: fnd_log.string(fnd_log.level_unexpected,l_full_path,SQLERRM);
1000: end if;
1001:
1002: END get_page_int_trend_sql;
1003: