DBA Data[Home] [Help]

MATERIALIZED VIEW: APPS.PJI_TIME_DAY_MV

Source


SELECT /* 12.0: bug#4526784 */
       cday.report_date_julian,
       cday.report_date,
   	   'Fiscal Period :'||cperiod.name period_name,
	   cqtr.name qtr_name,
	   cyear.name year_name,
	   'FII_TIME_CAL_PERIOD' period_type,
	   cday.calendar_id,
	   cday.cal_period_id period_id,
	   cday.cal_qtr_id qtr_id,
	   cday.cal_year_id year_id,
	   cperiod.start_date period_start_date,
	   cperiod.end_date period_end_date,
	   cqtr.start_date qtr_start_date,
	   cqtr.end_date qtr_end_date,
	   cyear.start_date year_start_date,
	   cyear.end_date year_end_date,
	   cperiod.name period_original_name
FROM   fii_time_cal_day_mv cday,
       FII.FII_TIME_CAL_PERIOD cperiod,
	   FII.FII_TIME_CAL_QTR    cqtr,
	   FII.FII_TIME_CAL_YEAR   cyear
WHERE  cday.calendar_id   = cperiod.calendar_id
AND    cday.cal_period_id = cperiod.cal_period_id
AND    cday.calendar_id   = cqtr.calendar_id
AND    cday.cal_qtr_id    = cqtr.cal_qtr_id
AND    cday.calendar_id   = cyear.calendar_id
AND    cday.cal_year_id   = cyear.cal_year_id
AND    cday.calendar_id IN (SELECT DISTINCT gl_calendar_id FROM PJI.PJI_ORG_EXTR_INFO)
UNION ALL
SELECT cday.report_date_julian,
       cday.report_date,
	   'PA Period :'||cperiod.name period_name,
	   cqtr.name qtr_name,
	   cyear.name year_name,
	   'FII_TIME_PA_PERIOD' period_type,
	   cday.calendar_id,
	   cday.cal_period_id period_id,
	   cday.cal_qtr_id qtr_id,
	   cday.cal_year_id year_id,
	   cperiod.start_date period_start_date,
	   cperiod.end_date period_end_date,
	   cqtr.start_date qtr_start_date,
	   cqtr.end_date qtr_end_date,
	   cyear.start_date year_start_date,
	   cyear.end_date year_end_date,
	   cperiod.name period_original_name
FROM   fii_time_cal_day_mv cday,
       FII.FII_TIME_CAL_PERIOD cperiod,
	   FII.FII_TIME_CAL_QTR    cqtr,
	   FII.FII_TIME_CAL_YEAR   cyear
WHERE  cday.calendar_id   = cperiod.calendar_id
AND    cday.cal_period_id = cperiod.cal_period_id
AND    cday.calendar_id   = cqtr.calendar_id
AND    cday.cal_qtr_id    = cqtr.cal_qtr_id
AND    cday.calendar_id   = cyear.calendar_id
AND    cday.cal_year_id   = cyear.cal_year_id
AND    cday.calendar_id IN (SELECT DISTINCT pa_calendar_id FROM PJI.PJI_ORG_EXTR_INFO)
UNION ALL
SELECT eday.report_date_julian,
       eday.report_date,
   	   'Enterprise Period :'||eperiod.name period_name,
	   eqtr.name qtr_name,
	   eyear.name year_name,
	   'FII_TIME_ENT_PERIOD' period_type,
	   -1 calendar_id,
	   eday.ent_period_id period_id,
	   eday.ent_qtr_id qtr_id,
	   eday.ent_year_id year_id,
	   eperiod.start_date period_start_date,
	   eperiod.end_date period_end_date,
	   eqtr.start_date qtr_start_date,
	   eqtr.end_date qtr_end_date,
	   eyear.start_date year_start_date,
	   eyear.end_date year_end_date,
	   eperiod.name period_original_name
FROM   FII.FII_TIME_DAY eday,
       FII.FII_TIME_ENT_PERIOD eperiod,
	   FII.FII_TIME_ENT_QTR    eqtr,
	   FII.FII_TIME_ENT_YEAR   eyear
WHERE  eday.ent_period_id = eperiod.ent_period_id
AND    eday.ent_qtr_id    = eqtr.ent_qtr_id
AND    eday.ent_year_id   = eyear.ent_year_id
UNION ALL
SELECT eday.report_date_julian,
       eday.report_date,
   	   'Enterprise Week :'||eweek.name period_name,
	   NULL qtr_name,
	   NULL year_name,
	   'FII_TIME_WEEK' period_type,
	   -1 calendar_id,
	   eday.week_id period_id,
	   NULL qtr_id,
	   NULL year_id,
	   eweek.start_date period_start_date,
	   eweek.end_date period_end_date,
	   NULL qtr_start_date,
	   NULL qtr_end_date,
	   NULL year_start_date,
	   NULL year_end_date,
	   eweek.name period_original_name
FROM   FII.FII_TIME_DAY eday,
       FII.FII_TIME_WEEK eweek
WHERE  eday.week_id = eweek.week_id