The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT sr.incident_owner_id ,
count(sr.incident_id) col2
' || l_from_list || l_where_clause || '
and nvl(stat.close_flag,''N'') <> ''Y''
group by sr.incident_owner_id
order by 2 desc';
SELECT sr.incident_owner_id,
sum(decode(upper(sr.sr_creation_channel), ''WEB'',1,0)) col2
' || l_from_list || l_where_clause || '
and sr.incident_date >= trunc(sysdate)
and sr.incident_date < trunc(sysdate+1)
and sr.sr_creation_channel = ''WEB''
group by sr.incident_owner_id
order by 2 desc';
SELECT sr.incident_owner_id,
sum(decode(upper(sr.sr_creation_channel), ''PHONE'',1,0)) col2
' || l_from_list || l_where_clause || '
and sr.incident_date >= trunc(sysdate)
and sr.incident_date < trunc(sysdate+1)
and sr.sr_creation_channel = ''PHONE''
group by sr.incident_owner_id
order by 2 desc';
SELECT sr.incident_owner_id ,
count(sr.incident_id) col2
' || l_from_list || l_where_clause || '
and sr.close_date >= trunc(sysdate)
and sr.close_date < trunc(sysdate+1)
and nvl(stat.close_flag,''N'') = ''Y''
group by sr.incident_owner_id
order by 2 desc';
SELECT sr.incident_owner_id ,
count(sr.incident_id) col2
' || l_from_list || l_where_clause || '
group by sr.incident_owner_id
order by 1 desc';
SELECT distinct rsc.resource_id incident_owner_id,
substr(rsc.source_name,1,50) col2
' || l_from_list3 || l_where_clause3 || '
order by 2 asc';
insert into biv_tmp_rt2(report_code, col1, col4, session_id)
SELECT ''X'', incident_owner_id, col2, :session_id
FROM (' || l_sql_sttmnt || ')
WHERE rownum <= :rows_to_display ';-- || biv_core_pkg.g_disp;
biv_core_pkg.update_base_col_desc('biv_tmp_rt2');
SELECT sr.incident_owner_id col1,
1 col4, 0 col6, 0 col8, 0 col10
' || l_from_list || l_where_clause || '
and nvl(stat.close_flag,''N'') <> ''Y''
UNION ALL
SELECT sr.incident_owner_id,
0,decode(upper(sr.sr_creation_channel), ''WEB'',1,0),
decode(upper(sr.sr_creation_channel), ''PHONE'',1,0),0
' || l_from_list || l_where_clause || '
and sr.incident_date >= trunc(sysdate)
and sr.incident_date < trunc(sysdate+1)
UNION ALL
SELECT sr.incident_owner_id ,
0, 0, 0, 1
' || l_from_list || l_where_clause || '
and sr.close_date >= trunc(sysdate)
and sr.close_date < trunc(sysdate+1)
and nvl(stat.close_flag,''N'') = ''Y''';
SELECT to_number(col1), 0,0,0,0
FROM biv_tmp_rt2 rep
WHERE session_id = :session_id
';
SELECT col1, sum(col4) col4, sum(col6) col6,
sum(col8) col8, sum(col10) col10
FROM (' || l_sql_sttmnt || ')
group by col1';
insert into biv_tmp_rt2 (report_code,rowno,
col1, col4, col6, col8, col10, col12, session_id)
SELECT ''Y'', rownum,
col1, col4, col6, col8, col10, ''N'', :session_id
FROM (' || l_sql_sttmnt || ')
';
biv_core_pkg.update_base_col_desc('biv_tmp_rt2');
insert into biv_tmp_rt2(report_code,rowno,id,
col1,col2,col4,col6,col8,col10,col12,col3,col5,col7,col9,
session_id)
SELECT ''BIV_RT_AGENT_REPORT'', rownum,col1,
col1, col2, col4, col6, col8, col10,col12,
col1 ,
col1 ,
col1 ,
col1 ,
session_id
FROM (SELECT col2,col4, col6,col8,col10,col12, col1, session_id
FROM biv_tmp_rt2
WHERE report_code = ''Y''
and session_id = :session_id
order by ' || l_order_by || ', col2
)
WHERE rownum <= :rows_to_display ';-- || nvl(biv_core_pkg.g_disp,200);
delete FROM biv_tmp_rt2
WHERE report_code in ('X', 'Y')
and session_id = l_session_id
;
update biv_tmp_rt2
set col1 = 'resource' || biv_core_pkg.g_param_sep ||
-- 'ID' || biv_core_pkg.g_value_sep || col1,
'p_resource_id' || biv_core_pkg.g_value_sep || col1,
col3 = l_new_param_str || nvl(col1,biv_core_pkg.g_null) ||
biv_core_pkg.g_param_sep ||
'P_BLOG'|| biv_core_pkg.g_value_sep || 'Y',
col7 = l_new_param_str || nvl(col1,biv_core_pkg.g_null) ||
biv_core_pkg.g_param_sep ||
'P_CHNL' || biv_core_pkg.g_value_sep || 'PHONE' ||
biv_core_pkg.g_param_sep || 'P_TODAY_ONLY' ||
biv_core_pkg.g_value_sep || 'Y',
col5 = l_new_param_str || nvl(col1,biv_core_pkg.g_null) ||
biv_core_pkg.g_param_sep ||
'P_CHNL' || biv_core_pkg.g_value_sep || 'WEB' ||
biv_core_pkg.g_param_sep || 'P_TODAY_ONLY' ||
biv_core_pkg.g_value_sep || 'Y',
col9 = l_new_param_str || nvl(col1,biv_core_pkg.g_null) ||
biv_core_pkg.g_param_sep ||
'P_CLOSE_SR' || biv_core_pkg.g_value_sep || 'Y' ||
biv_core_pkg.g_param_sep || 'P_CL_ST' ||
biv_core_pkg.g_value_sep || l_dt ||
biv_core_pkg.g_param_sep || 'P_CL_END' ||
biv_core_pkg.g_value_sep || l_dt ,
creation_date = sysdate
WHERE report_code = 'BIV_RT_AGENT_REPORT'
and session_id = l_session_id;
update biv_tmp_rt2 rpt
set col12 = 'Y'
WHERE session_id = l_session_id
and report_code = 'BIV_RT_AGENT_REPORT'
and exists ( SELECT 1 FROM JTF_RS_WEB_AVAILABLE_V avl
WHERE avl.resource_id = rpt.id);
SELECT count(*) into l_ttl_recs
FROM biv_tmp_rt2
WHERE report_code = 'BIV_RT_AGENT_REPORT'
and session_id = l_session_id;
insert into biv_tmp_rt2 (report_code, rowno,
col4, col6, col8, col10, col13,session_id)
SELECT report_code, max(rowno) + 1, sum(col4), sum(col6), sum(col8),
sum(col10) ,'Y', session_id
FROM biv_tmp_rt2
WHERE session_id = l_session_id
and report_code = 'BIV_RT_AGENT_REPORT'
group by report_code, session_id;
update biv_tmp_rt2
set col2 = l_ttl_desc,
col1 = 'resource' || biv_core_pkg.g_param_sep ||
'p_resource_id' || biv_core_pkg.g_value_sep || col1,
col3 = l_new_param_str ||
'P_BLOG'|| biv_core_pkg.g_value_sep || 'Y',
col7 = l_new_param_str ||
'P_CHNL' || biv_core_pkg.g_value_sep || 'PHONE' ||
biv_core_pkg.g_param_sep || 'P_TODAY_ONLY' ||
biv_core_pkg.g_value_sep || 'Y',
col5 = l_new_param_str ||
'P_CHNL' || biv_core_pkg.g_value_sep || 'WEB' ||
biv_core_pkg.g_param_sep || 'P_TODAY_ONLY' ||
biv_core_pkg.g_value_sep || 'Y',
col9 = l_new_param_str ||
'P_CLOSE_SR' || biv_core_pkg.g_value_sep || 'Y' ||
biv_core_pkg.g_param_sep || 'P_CL_ST' ||
biv_core_pkg.g_value_sep || l_dt ||
biv_core_pkg.g_param_sep || 'P_CL_END' ||
biv_core_pkg.g_value_sep || l_dt ,
creation_date = sysdate
WHERE report_code = 'BIV_RT_AGENT_REPORT'
and session_id = l_session_id
and col13 = 'Y';
insert into biv_tmp_rt2 (report_code, session_id,col2)
values('BIV_RT_AGENT_REPORT',l_session_id, l_new_param_str);
not get selected. so total backlog in total line will not represent
TOTAL backlog. when click on total backlog, it displays the TOTAL
backlog which obivously does not match the total line value.
if (biv_core_pkg.g_srt_by = '2') then
l_sql_sttmnt := '
SELECT ' || biv_core_pkg.g_base_column || ' col1,
count(sr.incident_id) col2
' || l_from_list || l_where_clause || '
and sr.incident_date >= trunc(sysdate)
and sr.incident_date < trunc(sysdate+1)
group by ' || biv_core_pkg.g_base_column || '
order by 2 desc ';
SELECT ' || biv_core_pkg.g_base_column || ' col1,
count(sr.incident_id) col2
' || l_from_list2 || l_where_clause2 || '
and nvl(stat.close_flag,''N'') = ''Y''
and sr.close_date >= trunc(sysdate)
and sr.close_date < trunc(sysdate+1)
group by ' || biv_core_pkg.g_base_column || '
order by 2 desc ';
SELECT ' || biv_core_pkg.g_base_column || ' col1,
count(sr.incident_id) col2
' || l_from_list2 || l_where_clause2 || '
and nvl(stat.close_flag,''N'') <> ''Y''
group by ' || biv_core_pkg.g_base_column || '
order by 2 desc ' ;
SELECT ' || biv_core_pkg.g_base_column || ' col1, ' ||
biv_core_pkg.g_base_column || ' col2 '
|| l_from_list || l_where_clause || '
group by ' || biv_core_pkg.g_base_column ;
insert into biv_tmp_rt2(report_code, col1, col4,session_id)
SELECT ''X'', col1, col2, :session_id
FROM (' || l_sql_sttmnt || ')
WHERE rownum <= :rows_to_display '; -- || biv_core_pkg.g_disp;
SELECT col1, sum(col4) col4, sum(col6) col6, sum(col8) col8,
:session_id session_id
FROM ( SELECT ' || biv_core_pkg.g_base_column || ' col1,
1 col4, 0 col6, 0 col8
' || l_from_list || l_where_clause || '
and sr.incident_date >= trunc(sysdate)
and sr.incident_date < trunc(sysdate+1)
UNION ALL
SELECT ' || biv_core_pkg.g_base_column || ' col1,
0, 1, 0
' || l_from_list2 || l_where_clause2 || '
and nvl(stat.close_flag,''N'') = ''Y''
and sr.close_date >= trunc(sysdate)
and sr.close_date < trunc(sysdate+1)
UNION ALL
SELECT ' || biv_core_pkg.g_base_column || ' col1,
0, 0, 1
' || l_from_list2 || l_where_clause2 || '
and nvl(stat.close_flag,''N'') <> ''Y''
) group by col1 ';
insert into biv_tmp_rt2 (report_code,rowno,
col1, col4, col6, col8,session_id)
SELECT ''Y'', rownum,
col1, col4, col6, col8,session_id
FROM (' || l_sql_sttmnt || ')';
biv_core_pkg.update_base_col_desc('biv_tmp_rt2');
insert into biv_tmp_rt2(report_code,rowno, col1, col2,
col4, col6, col8,session_id)
SELECT ''BIV_RT_MANAGER_REPORT'', rownum,
col1, col2, col4, col6, col8,session_id
FROM (SELECT col1, col2, col4, col6, col8,session_id
FROM biv_tmp_rt2
WHERE report_code =''Y''
and session_id = :session_id
order by ' || l_order_by || ')
WHERE rownum <= :rows_to_display '; --|| nvl(biv_core_pkg.g_disp,'10');
delete from biv_tmp_rt2
where session_id = l_session_id
and report_code in ('X', 'Y');
l_pos := 'Before Update of odd columns';
update biv_tmp_rt2
set col7 = l_new_param_str || nvl(col1,biv_core_pkg.g_null) ||
biv_core_pkg.g_param_sep ||
'P_BLOG'||biv_core_pkg.g_value_sep||'Y',
col3 = l_new_param_str || nvl(col1,biv_core_pkg.g_null) ||
biv_core_pkg.g_param_sep ||
'P_TODAY_ONLY'||biv_core_pkg.g_value_sep||'Y',
col5 = l_new_param_str || nvl(col1,biv_core_pkg.g_null) ||
biv_core_pkg.g_param_sep ||
'P_CLOSE_SR' || biv_core_pkg.g_value_sep || 'Y' ||
biv_core_pkg.g_param_sep || 'P_CL_ST' ||
biv_core_pkg.g_value_sep || l_dt ||
biv_core_pkg.g_param_sep || 'P_CL_END' ||
biv_core_pkg.g_value_sep || l_dt ,
creation_date = sysdate
WHERE report_code = 'BIV_RT_MANAGER_REPORT'
and session_id = l_session_id;
SELECT count(*) into l_ttl_recs
FROM biv_tmp_rt2
WHERE report_code = 'BIV_RT_MANAGER_REPORT'
and session_id = l_session_id;
insert into biv_tmp_rt2 (report_code, rowno,
col4, col6, col8, col13,session_id)
SELECT report_code, max(rowno) + 1, sum(col4), sum(col6), sum(col8),
'Y', session_id
FROM biv_tmp_rt2
WHERE session_id = l_session_id
and report_code = 'BIV_RT_MANAGER_REPORT'
group by report_code, session_id;
update biv_tmp_rt2
set col2 = l_ttl_desc,
col7 = l_ttl_param_str ||
'P_BLOG'||biv_core_pkg.g_value_sep||'Y',
col3 = l_ttl_param_str ||
'P_TODAY_ONLY'||biv_core_pkg.g_value_sep||'Y',
col5 = l_ttl_param_str ||
'P_CLOSE_SR' || biv_core_pkg.g_value_sep || 'Y' ||
biv_core_pkg.g_param_sep || 'P_CL_ST' ||
biv_core_pkg.g_value_sep || l_dt ||
biv_core_pkg.g_param_sep || 'P_CL_END' ||
biv_core_pkg.g_value_sep || l_dt ,
creation_date = sysdate
WHERE report_code = 'BIV_RT_MANAGER_REPORT'
and session_id = l_session_id
and col13 = 'Y';