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

SET VERIFY OFF
SET FEEDBACK OFF
WHENEVER OSERROR  EXIT FAILURE ROLLBACK
WHENEVER SQLERROR EXIT FAILURE ROLLBACK

DECLARE

  l_TABLE_NAME   CONSTANT
  fnd_tables.table_name%TYPE := 'XXAS_PERF_QUESTIONNAIRES';
  l_TRANS_TABLE  CONSTANT varchar2(1) := 'T';
  l_SEED_TABLE   CONSTANT varchar2(1) := 'S';
  l_DEF_NUM_LEN  CONSTANT number      := 38;
  l_DEF_DATE_LEN CONSTANT number      := 9;

BEGIN

  -- 
  -- Register XXAS_GOALS table 
  --
  ad_dd.register_table
    (p_appl_short_name => xxas_util_pkg.app
    ,p_tab_name        => l_TABLE_NAME
    ,p_tab_type        => l_TRANS_TABLE);

  -- 
  -- Register columns of XXAS_GOALS table 
  --
  FOR i IN ( SELECT *
               FROM all_tab_columns
               WHERE table_name = l_TABLE_NAME
               ORDER BY COLUMN_ID)
    LOOP
    ad_dd.register_column ( p_appl_short_name => xxas_util_pkg.app,
                                 p_tab_name   => l_TABLE_NAME,
                                 p_col_name   => i.COLUMN_NAME,
                                 p_col_seq    => i.COLUMN_ID,
                                 p_col_type   => i.DATA_TYPE,
                                 p_col_width  => i.DATA_LENGTH,
                                 p_nullable   => i.NULLABLE,
                                 p_translate  => 'N');
    END LOOP;

END;
/
COMMIT;
EXIT;
