The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT gp.period_name,
gps.closing_status,
gp.period_year,
gp.period_num,
gp.quarter_num,
gpt.description,
gp.start_date,
gp.end_date
FROM gl_period_statuses gps,
gl_periods gp,
gl_period_sets gpt
WHERE lower(gpt.period_set_name) like lower(calendarname)
AND gp.period_set_name like gpt.period_set_name
AND gp.period_type like periodtype
AND nvl(trunc(dateinperiod),gp.start_date) between gp.start_date
and gp.end_date
AND gps.period_name = gp.period_name
AND gps.set_of_books_id = setofbooksid
AND gps.application_id = appid
AND gp.period_year = nvl(periodyear, gp.period_year)
AND gp.period_num = nvl(periodnumber, gp.period_num)
ORDER BY gp.period_year, gp.period_num;
SELECT application_id
INTO appid
FROM fnd_application
WHERE application_short_name = 'SQLGL';