Error rendering element. Exception: Invalid column index
I am running the below sql in a grid control and getting the error message - "Error rendering element. Exception: Invalid column index"
How do I track down the error in the grid?
DECLARE
TYPE CURSOR_TYPE IS REF CURSOR;
result_cursor_out CURSOR_TYPE;
p_target_guid RAW(16);
p_query VARCHAR2(2000);
p_date_format VARCHAR2(128) := 'YYYY-MON';
p_target_name VARCHAR2(128);
p_i3_count NUMBER;
BEGIN
result_cursor_out := ??EMIP_BIND_RESULTS_CURSOR??;
p_target_guid := ??EMIP_BIND_TARGET_GUID??;
select target_name into p_target_name from mgmt$target where target_guid=p_target_guid;
OPEN result_cursor_out for
select a.search_code,a.name,a.total as "Total Incidents",decode(b.total_adjusted_miss,null,b.total_adjusted_miss,0) "Missed SLA (Adjusted)",
a.total-decode(c.total_unadjusted_miss,null,0,c.total_unadjusted_miss) "Missed SLA (Unadjusted)",
decode(round(((a.total - b.total_adjusted_miss)/a.total)*100,2),null,round(((a.total - b.total_adjusted_miss)/a.total)*100,2),100) "Total Adjusted Yield %",
round(decode(round(((a.total - c.total_unadjusted_miss)/a.total)*100,2),null,100,100-round(((a.total - c.total_unadjusted_miss)/a.total)*100,2)/100),2) "Total UnAdjusted Yield %"
from (
(SELECT
count(*) as total, sg.search_code, sg.NAME
FROM
tsgdw_task@awhsncp1 t,
tsgdw_operational_process@awhsncp1 op,
tsgdw_support_group@awhsncp1 sg,
tsgdw_person@awhsncp1 p
where sg.support_group_seq_id in (SELECT sg2.support_group_seq_id FROM tsgdw_support_group@awhsncp1 sg2
start with sg2.SEARCH_CODE = 'DBNONEC' --p_target_name
connect by prior sg2.support_group_seq_id=sg2.parent_support_group_seq_id)
and t.task_seq_id = op.task_seq_id
and t.task_seq_id = op.task_seq_id
and sg.support_group_seq_id = op.support_group_seq_id
and op.assigned_person_seq_id = p.person_seq_id
and sg.search_code = 'DBNONEC' p_target_name
and t.task_type = 'Incident'
--and op.EST_ACTUAL_END_DATETIME between ??EMIP_BIND_START_DATE?? and ??EMIP_BIND_END_DATE??
--and t.priority is not null
and to_char(est_actual_end_datetime) between to_date('11-03-2012','dd-mm-yyyy') AND to_date('18-03-2012','dd-mm-yyyy')
--and to_char(op.est_actual_end_datetime, 'MM-YYYY') = '01-2012'
group by sg.search_code, sg.name
))a,
(select count(*) as total_adjusted_miss,
sg.search_code,
sg.NAME
FROM
tsgdw_task@awhsncp1 t,
tsgdw_operational_process@awhsncp1 op,
tsgdw_support_group@awhsncp1 sg,
tsgdw_person@awhsncp1 p
where sg.support_group_seq_id in (SELECT sg2.support_group_seq_id FROM tsgdw_support_group@awhsncp1 sg2
start with sg2.SEARCH_CODE = 'DBNONEC' --p_target_name
connect by prior sg2.support_group_seq_id=sg2.parent_support_group_seq_id)
and t.task_seq_id = op.task_seq_id
and t.task_seq_id = op.task_seq_id
and sg.support_group_seq_id = op.support_group_seq_id
and op.assigned_person_seq_id = p.person_seq_id
and sg.search_code = 'AENONECDBSPT' p_target_name
and t.task_type in ('Incident')
--and op.EST_ACTUAL_END_DATETIME between ??EMIP_BIND_START_DATE?? and ??EMIP_BIND_END_DATE??
and to_char(est_actual_end_datetime) between to_date('11-03-2012','dd-mm-yyyy') AND to_date('18-03-2012','dd-mm-yyyy')
--and to_char(op.est_actual_end_datetime, 'MM-YYYY') = '02-2012'
--and t.priority is not null
and (((T.PRIORITY like ('%Immediate%')) AND ((OP.EST_ACTUAL_END_DATETIME - OP.EST_ACTUAL_START_DATETIME) * 24) - NVL(OP.EXCEPTION_DUR_HOURS_DEC, 0) <= 2) OR
((T.PRIORITY like ('%Critical%')) AND ((OP.EST_ACTUAL_END_DATETIME - OP.EST_ACTUAL_START_DATETIME) * 24) - NVL(OP.EXCEPTION_DUR_HOURS_DEC, 0) <= 4) or
((T.PRIORITY like ('%Urgent%')) AND OP.ACTUAL_DUR_HOURS_DECIMAL - NVL(OP.EXCEPTION_DUR_HOURS_DEC, 0) <= 24) or
((T.PRIORITY like ('%Medium%')) AND OP.ACTUAL_DUR_HOURS_DECIMAL - NVL(OP.EXCEPTION_DUR_HOURS_DEC, 0) <= 120) or
((T.PRIORITY like ('%Normal%')) AND OP.ACTUAL_DUR_HOURS_DECIMAL - NVL(OP.EXCEPTION_DUR_HOURS_DEC, 0) <= 72))
group by sg.search_code, sg.name) b,
(select count(*) as total_unadjusted_miss,
sg.search_code,
sg.NAME
FROM
tsgdw_task@awhsncp1 t,
tsgdw_operational_process@awhsncp1 op,
tsgdw_support_group@awhsncp1 sg,
tsgdw_person@awhsncp1 p
where sg.support_group_seq_id in (SELECT sg2.support_group_seq_id FROM tsgdw_support_group@awhsncp1 sg2
start with sg2.SEARCH_CODE = 'DBNONEC' --p_target_name
connect by prior sg2.support_group_seq_id=sg2.parent_support_group_seq_id)
and t.task_seq_id = op.task_seq_id
and t.task_seq_id = op.task_seq_id
and sg.support_group_seq_id = op.support_group_seq_id
and op.assigned_person_seq_id = p.person_seq_id
and sg.search_code = 'AENONECDBSPT' p_target_name
and t.task_type in ('Incident')
--and op.EST_ACTUAL_END_DATETIME between ??EMIP_BIND_START_DATE?? and ??EMIP_BIND_END_DATE??
--and to_char(op.est_actual_end_datetime, 'MM-YYYY') = '02-2012'
and to_char(est_actual_end_datetime) between to_date('11-03-2012','dd-mm-yyyy') AND to_date('18-03-2012','dd-mm-yyyy')
--and t.priority is not null
and (((T.PRIORITY like ('%Immediate%')) AND (OP.EST_ACTUAL_END_DATETIME - OP.EST_ACTUAL_START_DATETIME) * 24 < 2) or
((T.PRIORITY like ('%Critical%')) AND (OP.EST_ACTUAL_END_DATETIME - OP.EST_ACTUAL_START_DATETIME) * 24 < 4) or
((T.PRIORITY like ('%Urgent%')) AND OP.ACTUAL_DUR_HOURS_DECIMAL <= 24) or
((t.PRIORITY like ('%Medium%')) AND OP.ACTUAL_DUR_HOURS_DECIMAL <= 120) or
((T.PRIORITY like ('%Normal%')) AND OP.ACTUAL_DUR_HOURS_DECIMAL <= 72))
group by sg.search_code, sg.name
)c
where b.search_code(+)=a.search_code
and c.search_code(+)=a.search_code;
END;