/* $Id$ */
/*============================================================================*
 |                 Copyright (c) 2008 Applaud Solutions UK Ltd                |
 |                             All rights reserved                            |
 *===========================================================================*/

SET FEEDBACK OFF
SET SERVEROUT ON

DECLARE

  l_sql          varchar2(400);
  l_release_name varchar2(400);

BEGIN

  --
  -- Fetch the release using dynamic SQL in case
  -- the table does not exist, ie, an invalid
  -- Oracle Apps Release.
  --
  l_sql := ' SELECT   release_name '
        || ' FROM     fnd_product_groups '
        || ' ORDER BY product_group_id ';
  
  EXECUTE IMMEDIATE l_sql INTO l_release_name;

  dbms_output.put_line(l_release_name);

EXCEPTION

  WHEN others THEN
    --
    -- Table does not exist, invalid Oracle apps release
    --
    dbms_output.put_line('Unknown');
 
END;
/
COMMIT;
EXIT;
