Monday, May 19, 2014

Table registration script for Oracle Applications

Below scripts help you to registering the custom table with Oracle Application using AD_DD package, to develop Descriptive flexi fields or Web ADI, or OAF Personalization’s, etc.,  on custom table the table must be registered with Oracle applications

The API AD_DD package validates the table schema then it will insert one record in FND_TABLES for each table and one record in FND_COLUMNS for each columns

After you run the script you can verify your table is registered or not by running a select query on FND_TABLES and FND_COLUMNS tables.

DECLARE

 

 lv_table_name        VARCHAR2(100)  :='&Table_name';--'XXPO_EMP_INT';

 lv_application       VARCHAR2(10)   :='&_table_apps_name';--'XXZZPAY'  ;

 

BEGIN

 

  AD_DD.REGISTER_TABLE(p_appl_short_name  => lv_application

                      ,p_tab_name         => lv_table_name

                      ,p_tab_type         => 'T');

 

  COMMIT;

 

  FOR  i IN (SELECT table_name

                   ,column_name

                   ,column_id

                   ,data_type

                   ,data_length

                   ,nullable

                   ,'N' translate

             FROM  dba_tab_columns

             WHERE table_name=lv_table_name)  LOOP

 

    ad_dd.register_column (p_appl_short_name    => lv_application

                          ,p_tab_name           => i.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          => i.translate);

 

  END LOOP;

  COMMIT;

END;

IF you like this article, please comment or follow the blog.

No comments:

Post a Comment