The following lines contain the word 'select', 'insert', 'update' or 'delete':
INSERT
INTO fnd_oam_dscram_stats (STAT_ID,
RUN_STAT_ID,
SOURCE_OBJECT_TYPE,
SOURCE_OBJECT_ID,
OBJECT_START,
PRESTART_OBJECT_STATUS,
MESSAGE,
CREATED_BY,
CREATION_DATE,
LAST_UPDATED_BY,
LAST_UPDATE_DATE,
LAST_UPDATE_LOGIN)
VALUES (FND_OAM_DSCRAM_STATS_S.NEXTVAL,
p_run_stat_id,
p_source_object_type,
p_source_object_id,
p_start_time,
p_prestart_status,
p_start_message,
FND_GLOBAL.USER_ID,
SYSDATE,
FND_GLOBAL.USER_ID,
SYSDATE,
FND_GLOBAL.USER_ID)
RETURNING STAT_ID INTO l_stat_id;
UPDATE fnd_oam_dscram_stats
SET object_end = p_end_time,
postend_object_status = p_postend_status,
message = p_end_message,
last_updated_by = fnd_global.user_id,
last_update_login = fnd_global.user_id,
last_update_date = SYSDATE
WHERE run_stat_id = p_run_stat_id
AND source_object_type = p_source_object_type
AND source_object_id = p_source_object_id;
x_return_msg := 'Stat Complete for Run Stat ID('||p_run_stat_id||'), source type ('||p_source_object_type||'), source id ('||p_source_object_id||') updated '||SQL%ROWCOUNT||' stat rows. Should be 1.';
SELECT FND_OAM_DSCRAM_STATS_S.NEXTVAL
INTO l_run_stat_id
FROM DUAL;
INSERT
INTO fnd_oam_dscram_stats (STAT_ID,
RUN_STAT_ID,
SOURCE_OBJECT_TYPE,
SOURCE_OBJECT_ID,
OBJECT_START,
PRESTART_OBJECT_STATUS,
MESSAGE,
CREATED_BY,
CREATION_DATE,
LAST_UPDATED_BY,
LAST_UPDATE_DATE,
LAST_UPDATE_LOGIN)
VALUES (l_run_stat_id,
l_run_stat_id,
FND_OAM_DSCRAM_UTILS_PKG.G_TYPE_RUN,
p_run_id,
p_start_time,
p_prestart_status,
p_start_message,
FND_GLOBAL.USER_ID,
SYSDATE,
FND_GLOBAL.USER_ID,
SYSDATE,
FND_GLOBAL.USER_ID);
SELECT last_run_stat_id
INTO l_run_stat_id
FROM fnd_oam_dscram_runs_b
WHERE run_id = p_run_id;
fnd_oam_debug.log(6, l_ctxt, 'Skipping update because of non-final status '||p_postend_status||'. This should not happen.');
SELECT stat_id
INTO l_stat_id
FROM fnd_oam_dscram_stats
WHERE run_stat_id = p_run_stat_id
AND source_object_type = p_source_object_type
AND source_object_id = p_source_object_id;