The following lines contain the word 'select', 'insert', 'update' or 'delete':
/* Form the SQL string to insert the rows into the temp table */
g_sqlstmt := '
INSERT /*+ PARALLEL(tr,2) */ INTO BIX_DM_REPORT tr (
session_id,
report_code
, col3
, col4
, col5
, col6
, col8
, col10
, col12
, col13
, col14
, col15
, col16
, col17
, col18
, col20
, col22
, col23
, col24
, col25
, col26
, col27
, col28
, col30
, col32
, col34
, col36
, col38
, col40 ) ';
g_sqlstmt := g_sqlstmt || ' (SELECT ' || to_char(l_session_id) || ',' || ' ''BIX_AGENT_CLASS_REPORT'' ';
/* Form the SQL string to insert the rows into the temp table */
g_sqlstmt := '
INSERT /*+ PARALLEL(tr,2) */ INTO BIX_DM_REPORT tr (
session_id,
report_code
, col2
, col3
, col4
, col5
, col6
, col8
, col10
, col12
, col13
, col14
, col15
, col16
, col17
, col18
, col20
, col22
, col23
, col24
, col25
, col26
, col27
, col28
, col30
, col32
, col34
, col36
, col38
, col40 ) ';
g_sqlstmt := g_sqlstmt || ' (SELECT ' || to_char(l_session_id) || ',' || ' ''BIX_AGENT_CLASS_REPORT'' ';
PROCEDURE insert_rs_detail_temp_table(p_agent_id IN NUMBER)
IS
l_unknown varchar2(100);
select nvl(classification,l_unknown) className,
classification_id classId
from cct_classifications
where g_class = -999
or classification_id = g_class;
select bix_util_pkg.get_null_lookup into l_unknown
from dual;
SELECT meaning
into l_unknown
FROM fnd_lookups
WHERE lookup_type = 'BIX_DM_NULL_DESC'
AND lookup_code = 'NULL';
/* Form and execute the SQL statement to insert into the temp table */
/* all the detail rows coreesponding to the agent , user has chosen */
g_idx := g_idx+1;
END insert_rs_detail_temp_table;
PROCEDURE insert_rs_total_temp_table(p_group_id IN NUMBER)
IS
BEGIN
/* Form and execute the SQL statement to insert into the temp table */
/* all the rows coreesponding to the agent user has chosen */
g_idx := g_idx+1;
END insert_rs_total_temp_table;
PROCEDURE insert_group_temp_table(p_group_id IN NUMBER)
IS
idx number;
/* Form and execute the SQL statement to insert into the temp table */
/* the total row corresponding to the agent group user has chosen */
select count( distinct(b.resource_id) ) into agentNum
from bix_dm_agent_call_sum b, JTF_RS_GROUP_MEMBERS j
where group_id = p_group_id
and b.resource_id = j.resource_id;
/* Form and execute the SQL statement to insert into the temp table all */
/* the child agent groups corresponding to the agent group user has chosen */
idx := g_idx+1;
END insert_group_temp_table;
PROCEDURE insert_group_temp_table_child(p_group_id IN NUMBER)
IS
BEGIN
/* Form and execute the SQL statement to insert into the temp table all */
/* the child agent groups corresponding to the agent group user has chosen */
g_idx := g_idx+1;
END insert_group_temp_table_child;
SELECT MAX(period_start_date)
INTO v_temp_date
FROM bix_dm_agent_call_sum;
select col32 prefix
from BIX_DM_REPORT
where report_code = 'BIX_AGENT_CLASS_REPORT'
and col34 = 'LIST'
and session_id = l_session_id
and col5= to_char(v_agent_id);
delete from BIX_DM_REPORT
where session_id = l_session_id
and report_code = 'BIX_AGENT_CLASS_REPORT';
SELECT sysdate
INTO g_sysdate
FROM dual;
SELECT fnd_profile.value('BIX_DM_RPT_TIME_RANGE')
INTO g_time_range
FROM dual;
SELECT TO_NUMBER(substr(g_parent, 2, decode(instr(g_parent,'c'), 0, length(g_parent), instr(g_parent,'c')-2)))
INTO v_group_id
FROM dual;
/* If the user has selected "All" for agent group paramter , display the default group of the user */
IF (v_group_id = -999) THEN
SELECT fnd_profile.value('BIX_DM_DEFAULT_GROUP')
INTO v_group_id
FROM dual;
/* or the user has selected "all" as agent group paramter and (s)he is not assigned to any default group */
IF (v_group_id IS NULL) THEN
RETURN;
insert_group_temp_table(v_group_id);
insert_rs_total_temp_table(v_group_id);
UPDATE BIX_DM_REPORT
SET col3 = 'p' || v_group_id || 'c' || to_char(v_agent_id) || 'y'
WHERE col3 = 'p' || v_group_id || 'c' || to_char(v_agent_id) || 'n';
/* summary table and insert them into bix temp table */
insert_rs_detail_temp_table(v_agent_id);
/* update index order that the detail get listed under the agent */
update BIX_DM_REPORT
set col32 = concat(l_prefix, col32)
where report_code = 'BIX_AGENT_CLASS_REPORT'
and session_id = l_session_id
and col34 = 'DETAIL';
update BIX_DM_REPORT
set col32 = concat(l_prefix, col32)
where report_code = 'BIX_AGENT_CLASS_REPORT'
and session_id = l_session_id
and col34 = 'DETAIL'; */