DBA Data[Home] [Help]

APPS.ENI_DBI_OEX_T_PKG SQL Statements

The following lines contain the word 'select', 'insert', 'update' or 'delete':

Line: 154

			SELECT
				t.name AS VIEWBY,
				SUM(case when ftrs.report_date = t.c_end_date
				THEN NVL(fgbm.' || l_currency_column ||   ', 0)
				ELSE 0 END) AS ENI_MEASURE1,
				SUM(case when ftrs.report_date = t.p_end_date
				THEN NVL(fgbm.' || l_currency_column ||   ', 0)
				ELSE 0 END) AS ENI_MEASURE2
			FROM
				eni_dbi_gl_base_sum_mv fgbm,
				fii_time_rpt_struct ftrs,
				(
					SELECT
						c.name,
						c.'||l_id_column||',
						c.start_date AS start_date,
						(case when  '|| '&' || 'BIS_CURRENT_ASOF_DATE < c.end_date
						then  '|| '&' || 'BIS_CURRENT_ASOF_DATE else c.end_date end ) AS c_end_date,
						(case when '|| '&' || 'BIS_PREVIOUS_ASOF_DATE < p.end_date
                                                then '|| '&' || 'BIS_PREVIOUS_ASOF_DATE else p.end_date end) AS p_end_date
					FROM
						' || l_period_type ||' c, ' || l_period_type || ' p
					WHERE
						c.start_date >= ' || '&' || 'BIS_CURRENT_REPORT_START_DATE
						AND c.'||l_id_column||' <= :CUR_PERIOD_ID
						AND p.start_date >= ' || '&' || 'BIS_PREVIOUS_REPORT_START_DATE
						' || l_comp_where || '
				) t
			WHERE
				(
					t.c_end_date = ftrs.report_date
					OR t.p_end_date = ftrs.report_date
				)
				AND fgbm.time_id (+) = ftrs.time_id
				AND BITAND(ftrs.record_type_id, ' || '&' || 'BIS_NESTED_PATTERN ) = ftrs.record_type_id
                                ' || l_where_clause || '
			GROUP BY
				' || l_group_by_clause || '
			ORDER BY
				' || l_order_by;