The following lines contain the word 'select', 'insert', 'update' or 'delete':
select sequence
into l_curr_year
from fii_time_ent_year
where as_of_date between start_date and end_date;
select min(start_date)
into l_date
from fii_time_ent_year
where sequence>=l_curr_year-3;
select sequence, ent_year_id
into l_curr_qtr, l_curr_year
from fii_time_ent_qtr
where as_of_date between start_date and end_date;
select start_date
into l_date
from (select start_date
from fii_time_ent_qtr
where ((sequence>=l_curr_qtr+1 and ent_year_id=l_curr_year-1)
or (sequence>=1 and ent_year_id=l_curr_year))
order by start_date)
where rownum <= 1;
select start_date
into l_date
from (select start_date
from fii_time_ent_qtr
where ((sequence>=l_curr_qtr+1 and ent_year_id=l_curr_year-2)
or (sequence>=1 and ent_year_id=l_curr_year-1))
order by start_date)
where rownum <= 1;
select p.sequence, q.ent_year_id
into l_curr_period, l_curr_year
from fii_time_ent_period p, fii_time_ent_qtr q
where p.ent_qtr_id=q.ent_qtr_id
and as_of_date between p.start_date and p.end_date;
select start_date
into l_date
from (select p.start_date
from fii_time_ent_period p, fii_time_ent_qtr q
where p.ent_qtr_id=q.ent_qtr_id
and ((p.sequence>=l_curr_period+1 and q.ent_year_id=l_curr_year-1)
or (p.sequence>=1 and q.ent_year_id=l_curr_year))
order by p.start_date)
where rownum <= 1;
select start_date
into l_week_start_date
from fii_time_week
where as_of_date between start_date and end_date;
select min(start_date)
into l_date
from fii_time_week
where start_date>=l_week_start_date-7*12;