Open GL periods in Oracle Apps 11i

Quick and overly simple script to determine status of GL periods. The example looks for period names ending in ’11’ (ie, from 2011).

SELECT 
  gps.period_num,
  gps.period_name,
  gps.set_of_books_id,
  gsob.period_set_name,
  DECODE (gps.closing_status,
    'O', 'Open',
    'C', 'Closed',
    'F', 'Future',
    'N', 'Never') status
FROM 
  gl_period_statuses gps,
  gl_sets_of_books gsob
where 
  gps.period_name like '%11' and 
  gps.application_id = 101 and
  gsob.set_of_books_id = gps.set_of_books_id
order by 
  gps.period_num