The following lines contain the word 'select', 'insert', 'update' or 'delete':
'SELECT outcome_code BIX_PMV_AI_OUTCOME,
NVL(result_code,:l_unknown) BIX_PMV_AI_RESULT
,NVL(reason_code,:l_unknown) BIX_PMV_AI_REASON
,NVL(c_count,0) BIX_PMV_AI_COUNT
,sum(nvl(c_count,0)) over() BIX_PMV_TOTAL1
,(NVL(c_count,0)*100/decode(c_counttot,0,null,c_counttot)) BIX_PMV_AI_PERTOTAL1
,(c_count*100/decode(c_counttot,0,null,c_counttot)) -
(p_count*100/decode(p_counttot,0,null,p_counttot)) BIX_PMV_AI_COUNTCHANGE
FROM
(';
l_view_by_select VARCHAR2(500) ;
, p_view_by_select => l_view_by_select
, p_view_by => l_view_by
);
/* pubalasu:Add columns to the select list of the innermost query */
poa_dbi_util_pkg.add_column(
p_col_tbl => l_col_tbl
, p_col_name => 'AGENTCALL_ORR_COUNT'
, p_grand_total => 'N'
, p_alias_name => 'count'
, p_prior_code => poa_dbi_util_pkg.COL_PRIOR_ONLY
, p_to_date_type => l_timetype
);
'SELECT * FROM
(
'
||
GET_MEASURES
||
'
(
select outcome_id,result_id,reason_id,c_count,p_count,
sum(c_count) over(partition by outcome_id) c_counttot,
sum(p_count) over(partition by outcome_id) p_counttot
from
'
||l_sqltext
|| ',' || bix_pmv_dbi_utl_pkg.get_orr_views
||get_zeronull_clause
;