The following lines contain the word 'select', 'insert', 'update' or 'delete':
select distinct('EXIST')
into exist_flag
from FND_HISTOGRAM_COLS
where application_id = 50
and table_name = 'AD_PATCH_COMMON_ACTIONS'
and column_name = 'ACTION_CODE';
fnd_stats.load_histogram_cols('INSERT', 50, 'AD_PATCH_COMMON_ACTIONS',
'ACTION_CODE',NULL, hsize=>250);
select distinct('EXIST')
into exist_flag
from FND_HISTOGRAM_COLS
where application_id = 50
and table_name = 'AD_FILES'
and column_name = 'IS_FLAGGED_FILE';
fnd_stats.load_histogram_cols('INSERT', 50, 'AD_FILES',
'IS_FLAGGED_FILE', NULL, hsize=>250);
p_rows_inserted_this_run number,
p_gather_stats_flag boolean,
p_commit_flag boolean,
p_gathered_stats_flag out NOCOPY boolean)
is
l_count_when_last_analyzed number := 0;
validate_increment(p_rows_inserted_this_run);
select
nvl(to_number(attribute1), 0),
nvl(to_number(attribute2), 0)
into
l_count_when_last_analyzed,
l_count_till_last_run
from ad_timestamps
where type = 'COUNTS_FOR_ANALYZE'
and attribute = p_subsystem_code;
l_newcount := l_count_till_last_run + p_rows_inserted_this_run;
to_char(p_rows_inserted_this_run));
update ad_timestamps
set attribute1 = to_char(l_newcount),
attribute2 = to_char(l_newcount),
timestamp = sysdate
where type = 'COUNTS_FOR_ANALYZE'
and attribute = p_subsystem_code;
update ad_timestamps
set attribute2 = to_char(l_newcount),
timestamp = sysdate
where type = 'COUNTS_FOR_ANALYZE'
and attribute = p_subsystem_code;
insert into ad_timestamps
(
type, attribute, timestamp,
attribute1, attribute2
) values
(
'COUNTS_FOR_ANALYZE', p_subsystem_code, sysdate,
to_char(l_count_when_last_analyzed), to_char(l_newcount)
);