============================================================

[Example] How to register table into Oracle ERP applicaiton

說明:

  1. XXDII : 是我們自己註冊的客製程式的application module code
  2. XXDII_UPI_WSH_PACK_HEADERS : 是本次的主角,要到Oacle ERP裡註冊的資料表名稱

 

BEGIN
   -- Table Register
   AD_DD.REGISTER_TABLE( 'XXDII' --Application name in which you want to register
                       , 'XXDII_UPI_WSH_PACK_HEADERS' --Table Name
                       , 'T' -- T for Transaction data , S for seeded data
                       , 512 -- default 512
                       , 10 -- Default 10
                       , 70 --Default 70
                            );

------------------------------------

-- Column Register

--每個欄位都需要呼叫這個AD_DD.REGISTER_COLUMN,你可以用loop簡化它,這只是個範例 ----

----------------------------------

   AD_DD.REGISTER_COLUMN( P_APPL_SHORT_NAME    => 'XXDII' --Application Name
                        , P_TAB_NAME           => 'XXDII_UPI_WSH_PACK_HEADERS' --Table Name
                        , P_COL_NAME           => 'PACKING_HEADER_ID' --Column Name
                        , P_COL_SEQ            => 1 --Column Sequence
                        , P_COL_TYPE           => 'NUMBER' --Column Data type
                        , P_COL_WIDTH          => 10 --Column Width
                        , P_NULLABLE           => 'N' --Use'N' if mandatory column otherwise 'Y'
                        , P_TRANSLATE          => 'N' --Use 'Y' if this has translatable values
                        , P_PRECISION          => NULL --Decimal precision
                        , P_SCALE              => NULL --Number of digits in number
                                                       );

  AD_DD.REGISTER_COLUMN( P_APPL_SHORT_NAME    => 'XXDII' --Application Name
                        , P_TAB_NAME           => 'XXDII_UPI_WSH_PACK_HEADERS' --Table Name
                        , P_COL_NAME           => 'DELIVERY_TYPE' --Column Name
                        , P_COL_SEQ            => 2 --Column Sequence
                        , P_COL_TYPE           => 'VARCHAR2' --Column Data type
                        , P_COL_WIDTH          => 1 --Column Width
                        , P_NULLABLE           => 'N' --Use'N' if mandatory column otherwise 'Y'
                        , P_TRANSLATE          => 'N' --Use 'Y' if this has translatable values
                        , P_PRECISION          => NULL --Decimal precision
                        , P_SCALE              => NULL --Number of digits in number
                                                       );

COMMIT;

END;

============================================================

執行完畢後,你可以上那裡查找呢?   繼續看下去..

  • Responsibility : Application Developer
  • Navigator : Application > Database > Table

Query find out your table name, 因為我註冊了五個欄位,所以你會看到四個。

image

成功...

快來試試看吧..~

文章標籤
創作者介紹

Oracle ERP學習經驗分享

SomebabyTina 發表在 痞客邦 留言(0) 人氣()