The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT VALUE into l_status from IEM_COMP_RT_STATS -- New Table
WHERE TYPE='MAILPROC' and PARAM='RUNTIME STATUS';
INSERT into IEM_COMP_RT_STATS
(
COMP_RT_STATS_ID,
TYPE,
PARAM,
VALUE,
LAST_UPDATED_BY,
LAST_UPDATE_DATE)
VALUES
(-1,
'MAILPROC',
'RUNTIME STATUS',
'T',
99999,
SYSDATE);
delete from IEM_COMP_RT_STATS
WHERE TYPE='MAILPROC' and PARAM='RUNTIME STATUS'
and rownum<
(select count(*) from IEM_COMP_RT_STATS
WHERE TYPE='MAILPROC' and PARAM='RUNTIME STATUS');
SELECT value into l_status from IEM_COMP_RT_STATS
WHERE type='MAILPROC' and param='RUNTIME STATUS';
UPDATE IEM_COMP_RT_STATS
set VALUE='F'
WHERE TYPE='MAILPROC' and PARAM='RUNTIME STATUS';
SELECT item_key
from wf_item_activity_statuses
where item_type=p_item_type
and activity_status = 'ERROR'
and begin_date<=p_end_date;