EBS WebADI 存儲過程增長參數

CREATE OR REPLACE FUNCTION CUX_EXEC_SQL (P_SQL IN VARCHAR2)
   RETURN NUMBER
AS
   L_CNT   NUMBER;
BEGIN
   EXECUTE IMMEDIATE P_SQL INTO L_CNT;web

   RETURN L_CNT;
EXCEPTION
   WHEN OTHERS
   THEN
      RETURN 0;
END;session

--DROP TABLE CUX_TABLES_COUNTER;app


CREATE TABLE CUX_TABLES_COUNTER AS
SELECT 'SELECT COUNT(*) FROM ' || OWNER || '.' || OBJECT_NAME STRING_CNT, -1 CNT1, -1 CNT2
FROM DBA_OBJECTS X
WHERE 1=1
AND X.OWNER = 'BNE'
AND X.OBJECT_TYPE = 'TABLE'
AND X.OBJECT_NAME LIKE 'BNE%'
;佈局


UPDATE CUX_TABLES_COUNTER
SET CNT1 = CUX_EXEC_SQL(STRING_CNT);code

UPDATE CUX_TABLES_COUNTER
SET CNT2 = CUX_EXEC_SQL(STRING_CNT);接口

SELECT *
FROM CUX_TABLES_COUNTER
where 1=1
and cnt1 <> cnt2;io

--SELECT COUNT(*) FROM BNE.BNE_ATTRIBUTES
--SELECT COUNT(*) FROM BNE.BNE_CONTENTS_B
--SELECT COUNT(*) FROM BNE.BNE_CONTENTS_TL
--SELECT COUNT(*) FROM BNE.BNE_INTEGRATORS_B
--SELECT COUNT(*) FROM BNE.BNE_INTEGRATORS_TL
--SELECT COUNT(*) FROM BNE.BNE_INTERFACES_B
--SELECT COUNT(*) FROM BNE.BNE_INTERFACES_TL
--SELECT COUNT(*) FROM BNE.BNE_INTERFACE_COLS_B
--SELECT COUNT(*) FROM BNE.BNE_INTERFACE_COLS_TL
--SELECT COUNT(*) FROM BNE.BNE_LAYOUTS_B
--SELECT COUNT(*) FROM BNE.BNE_LAYOUTS_TL
--SELECT COUNT(*) FROM BNE.BNE_LAYOUT_BLOCKS_B
--SELECT COUNT(*) FROM BNE.BNE_LAYOUT_BLOCKS_TL
--SELECT COUNT(*) FROM BNE.BNE_LAYOUT_COLS
--SELECT COUNT(*) FROM BNE.BNE_PARAM_LISTS_B
--SELECT COUNT(*) FROM BNE.BNE_PARAM_LISTS_TL
--SELECT COUNT(*) FROM BNE.BNE_PARAM_LIST_ITEMS
--SELECT COUNT(*) FROM BNE.BNE_SECURED_OBJECTS
--SELECT COUNT(*) FROM BNE.BNE_SECURITY_RULES
 
 後臺

--webadi過程接口,原來有18個傳入參數,在定義webadi屬性字段時增長了5個不屬於過程當中參數的自定義字段,目前須要向過程當中增長兩個參數
--CUX_JOB_IMPORT_PKG.IMPORT_JOB     INTERFACE_CODE LIKE CUXJIMP01layout

--將不屬性過程參數的自定義字段向後推兩個位置
UPDATE   BNE_INTERFACE_COLS_B
SET SEQUENCE_NUM =  SEQUENCE_NUM + 2,
DISPLAY_ORDER = DISPLAY_ORDER + 2
WHERE 1 = 1
AND SEQUENCE_NUM > 18
AND INTERFACE_CODE = 'CUXJIMP01_XINTG_INTF1'
;數據

--INSERT PARAMETERS TO TABLE BNE_INTERFACE_COLS_B
INSERT INTO BNE_INTERFACE_COLS_B
SELECT
APPLICATION_ID, INTERFACE_CODE, OBJECT_VERSION_NUMBER, 19 SEQUENCE_NUM, INTERFACE_COL_TYPE, 'P_ALTERNATE_BOM_DESIGNATOR' INTERFACE_COL_NAME, ENABLED_FLAG, REQUIRED_FLAG,  DISPLAY_FLAG, READ_ONLY_FLAG, NOT_NULL_FLAG, SUMMARY_FLAG, MAPPING_ENABLED_FLAG, DATA_TYPE, FIELD_SIZE, DEFAULT_TYPE, DEFAULT_VALUE, SEGMENT_NUMBER, GROUP_NAME, OA_FLEX_CODE, OA_CONCAT_FLEX, VAL_TYPE, VAL_ID_COL, VAL_MEAN_COL, VAL_DESC_COL, VAL_OBJ_NAME, VAL_ADDL_W_C, VAL_COMPONENT_APP_ID, VAL_COMPONENT_CODE, OA_FLEX_NUM, OA_FLEX_APPLICATION_ID, 19 DISPLAY_ORDER, 19 UPLOAD_PARAM_LIST_ITEM_NUM, EXPANDED_SQL_QUERY, CREATED_BY, CREATION_DATE, LAST_UPDATED_BY, LAST_UPDATE_LOGIN, LAST_UPDATE_DATE, LOV_TYPE, OFFLINE_LOV_ENABLED_FLAG, VARIABLE_DATA_TYPE_CLASS, VAL_QUERY_APP_ID, VAL_QUERY_CODE, EXPANDED_SQL_QUERY_APP_ID, EXPANDED_SQL_QUERY_CODE, VIEWER_GROUP, EDIT_TYPE, DISPLAY_WIDTH, ZD_EDITION_NAME
FROM BNE_INTERFACE_COLS_B
WHERE 1 = 1
AND INTERFACE_COL_NAME = 'P_COMMENTS'
AND INTERFACE_CODE = 'CUXJIMP01_XINTG_INTF1';

INSERT INTO BNE_INTERFACE_COLS_B
SELECT
APPLICATION_ID, INTERFACE_CODE, OBJECT_VERSION_NUMBER, 20 SEQUENCE_NUM, INTERFACE_COL_TYPE, 'P_ALTERNATE_ROUTING_DESIGNATOR' INTERFACE_COL_NAME, ENABLED_FLAG, REQUIRED_FLAG,  DISPLAY_FLAG, READ_ONLY_FLAG, NOT_NULL_FLAG, SUMMARY_FLAG, MAPPING_ENABLED_FLAG, DATA_TYPE, FIELD_SIZE, DEFAULT_TYPE, DEFAULT_VALUE, SEGMENT_NUMBER, GROUP_NAME, OA_FLEX_CODE, OA_CONCAT_FLEX, VAL_TYPE, VAL_ID_COL, VAL_MEAN_COL, VAL_DESC_COL, VAL_OBJ_NAME, VAL_ADDL_W_C, VAL_COMPONENT_APP_ID, VAL_COMPONENT_CODE, OA_FLEX_NUM, OA_FLEX_APPLICATION_ID, 20 DISPLAY_ORDER, 20 UPLOAD_PARAM_LIST_ITEM_NUM, EXPANDED_SQL_QUERY, CREATED_BY, CREATION_DATE, LAST_UPDATED_BY, LAST_UPDATE_LOGIN, LAST_UPDATE_DATE, LOV_TYPE, OFFLINE_LOV_ENABLED_FLAG, VARIABLE_DATA_TYPE_CLASS, VAL_QUERY_APP_ID, VAL_QUERY_CODE, EXPANDED_SQL_QUERY_APP_ID, EXPANDED_SQL_QUERY_CODE, VIEWER_GROUP, EDIT_TYPE, DISPLAY_WIDTH, ZD_EDITION_NAME
FROM BNE_INTERFACE_COLS_B
WHERE 1 = 1
AND INTERFACE_COL_NAME = 'P_COMMENTS'
AND INTERFACE_CODE = 'CUXJIMP01_XINTG_INTF1';


--將不屬性過程參數的自定義字段向後推兩個位置
UPDATE   BNE_INTERFACE_COLS_TL
SET SEQUENCE_NUM =  SEQUENCE_NUM + 2
WHERE 1 = 1
AND SEQUENCE_NUM > 18
AND INTERFACE_CODE = 'CUXJIMP01_XINTG_INTF1'
;

--INSERT PARAMETERS TO TABLE BNE_INTERFACE_COLS_TL
INSERT INTO BNE_INTERFACE_COLS_TL
SELECT
APPLICATION_ID, INTERFACE_CODE, 19 SEQUENCE_NUM, LANGUAGE, SOURCE_LANG, USER_HINT, 'ALTERNATE_BOM_DESIGNATOR' PROMPT_LEFT, USER_HELP_TEXT, '清單替代項' PROMPT_ABOVE, CREATED_BY, CREATION_DATE, LAST_UPDATED_BY, LAST_UPDATE_LOGIN, LAST_UPDATE_DATE, ZD_EDITION_NAME
FROM BNE_INTERFACE_COLS_TL
WHERE 1 = 1
AND PROMPT_LEFT = 'COMMENTS'
AND INTERFACE_CODE = 'CUXJIMP01_XINTG_INTF1'
;

INSERT INTO BNE_INTERFACE_COLS_TL
SELECT
APPLICATION_ID, INTERFACE_CODE, 20 SEQUENCE_NUM, LANGUAGE, SOURCE_LANG, USER_HINT, 'ALTERNATE_ROUTING_DESIGNATOR' PROMPT_LEFT, USER_HELP_TEXT, '工藝替代項' PROMPT_ABOVE, CREATED_BY, CREATION_DATE, LAST_UPDATED_BY, LAST_UPDATE_LOGIN, LAST_UPDATE_DATE, ZD_EDITION_NAME
FROM BNE_INTERFACE_COLS_TL
WHERE 1 = 1
AND PROMPT_LEFT = 'COMMENTS'
AND INTERFACE_CODE = 'CUXJIMP01_XINTG_INTF1'
;

--INSERT PARAMETERS TO TABLE BNE_ATTRIBUTES
INSERT INTO BNE_ATTRIBUTES
SELECT
APPLICATION_ID, 'CUXJIMP01_XINTG_UPL1_A19' ATTRIBUTE_CODE, OBJECT_VERSION_NUMBER, 'P_ALTERNATE_BOM_DESIGNATOR' ATTRIBUTE1, ATTRIBUTE2, ATTRIBUTE3, ATTRIBUTE4, ATTRIBUTE5, ATTRIBUTE6, ATTRIBUTE7, ATTRIBUTE8, ATTRIBUTE9, ATTRIBUTE10, ATTRIBUTE11, ATTRIBUTE12, ATTRIBUTE13, ATTRIBUTE14, ATTRIBUTE15, ATTRIBUTE16, ATTRIBUTE17, ATTRIBUTE18, ATTRIBUTE19, ATTRIBUTE20, ATTRIBUTE21, ATTRIBUTE22, ATTRIBUTE23, ATTRIBUTE24, ATTRIBUTE25, ATTRIBUTE26, ATTRIBUTE27, ATTRIBUTE28, ATTRIBUTE29, ATTRIBUTE30, CREATED_BY, CREATION_DATE, LAST_UPDATED_BY, LAST_UPDATE_DATE, LAST_UPDATE_LOGIN, ATTRIBUTE_NAME1, ATTRIBUTE_NAME2, ATTRIBUTE_NAME3, ATTRIBUTE_NAME4, ATTRIBUTE_NAME5, ATTRIBUTE_NAME6, ATTRIBUTE_NAME7, ATTRIBUTE_NAME8, ATTRIBUTE_NAME9, ATTRIBUTE_NAME10, ATTRIBUTE_NAME11, ATTRIBUTE_NAME12, ATTRIBUTE_NAME13, ATTRIBUTE_NAME14, ATTRIBUTE_NAME15, ATTRIBUTE_NAME16, ATTRIBUTE_NAME17, ATTRIBUTE_NAME18, ATTRIBUTE_NAME19, ATTRIBUTE_NAME20, ATTRIBUTE_NAME21, ATTRIBUTE_NAME22, ATTRIBUTE_NAME23, ATTRIBUTE_NAME24, ATTRIBUTE_NAME25, ATTRIBUTE_NAME26, ATTRIBUTE_NAME27, ATTRIBUTE_NAME28, ATTRIBUTE_NAME29, ATTRIBUTE_NAME30, ZD_EDITION_NAME
FROM BNE_ATTRIBUTES
WHERE 1 = 1
AND ATTRIBUTE1 = 'P_COMMENTS'
AND ATTRIBUTE_CODE LIKE 'CUXJIMP01_XINTG_UPL1_A%'
ORDER BY TO_NUMBER (REPLACE (ATTRIBUTE_CODE, 'CUXJIMP01_XINTG_UPL1_A', ''));


INSERT INTO BNE_ATTRIBUTES
SELECT
APPLICATION_ID, 'CUXJIMP01_XINTG_UPL1_A20' ATTRIBUTE_CODE, OBJECT_VERSION_NUMBER, 'P_ALTERNATE_ROUTING_DESIGNATOR' ATTRIBUTE1, ATTRIBUTE2, ATTRIBUTE3, ATTRIBUTE4, ATTRIBUTE5, ATTRIBUTE6, ATTRIBUTE7, ATTRIBUTE8, ATTRIBUTE9, ATTRIBUTE10, ATTRIBUTE11, ATTRIBUTE12, ATTRIBUTE13, ATTRIBUTE14, ATTRIBUTE15, ATTRIBUTE16, ATTRIBUTE17, ATTRIBUTE18, ATTRIBUTE19, ATTRIBUTE20, ATTRIBUTE21, ATTRIBUTE22, ATTRIBUTE23, ATTRIBUTE24, ATTRIBUTE25, ATTRIBUTE26, ATTRIBUTE27, ATTRIBUTE28, ATTRIBUTE29, ATTRIBUTE30, CREATED_BY, CREATION_DATE, LAST_UPDATED_BY, LAST_UPDATE_DATE, LAST_UPDATE_LOGIN, ATTRIBUTE_NAME1, ATTRIBUTE_NAME2, ATTRIBUTE_NAME3, ATTRIBUTE_NAME4, ATTRIBUTE_NAME5, ATTRIBUTE_NAME6, ATTRIBUTE_NAME7, ATTRIBUTE_NAME8, ATTRIBUTE_NAME9, ATTRIBUTE_NAME10, ATTRIBUTE_NAME11, ATTRIBUTE_NAME12, ATTRIBUTE_NAME13, ATTRIBUTE_NAME14, ATTRIBUTE_NAME15, ATTRIBUTE_NAME16, ATTRIBUTE_NAME17, ATTRIBUTE_NAME18, ATTRIBUTE_NAME19, ATTRIBUTE_NAME20, ATTRIBUTE_NAME21, ATTRIBUTE_NAME22, ATTRIBUTE_NAME23, ATTRIBUTE_NAME24, ATTRIBUTE_NAME25, ATTRIBUTE_NAME26, ATTRIBUTE_NAME27, ATTRIBUTE_NAME28, ATTRIBUTE_NAME29, ATTRIBUTE_NAME30, ZD_EDITION_NAME
FROM BNE_ATTRIBUTES
WHERE 1 = 1
AND ATTRIBUTE1 = 'P_COMMENTS'
AND ATTRIBUTE_CODE LIKE 'CUXJIMP01_XINTG_UPL1_A%'
ORDER BY TO_NUMBER (REPLACE (ATTRIBUTE_CODE, 'CUXJIMP01_XINTG_UPL1_A', ''));


--INSERT PARAMETERS TO TABLE BNE_PARAM_LIST_ITEMS
INSERT INTO BNE_PARAM_LIST_ITEMS
SELECT
APPLICATION_ID, PARAM_LIST_CODE, 19 SEQUENCE_NUM, OBJECT_VERSION_NUMBER, PARAM_DEFN_APP_ID, PARAM_DEFN_CODE, 'P_ALTERNATE_BOM_DESIGNATOR' PARAM_NAME, ATTRIBUTE_APP_ID, 'CUXJIMP01_XINTG_UPL1_A19' ATTRIBUTE_CODE, STRING_VALUE, DATE_VALUE, NUMBER_VALUE, BOOLEAN_VALUE_FLAG, FORMULA_VALUE, DESC_VALUE, CREATED_BY, CREATION_DATE, LAST_UPDATED_BY, LAST_UPDATE_DATE, LAST_UPDATE_LOGIN, ZD_EDITION_NAME
FROM BNE_PARAM_LIST_ITEMS
WHERE 1 = 1
AND PARAM_NAME = 'P_COMMENTS'
AND PARAM_LIST_CODE LIKE 'CUXJIMP01_XINTG_UPL1%';


INSERT INTO BNE_PARAM_LIST_ITEMS
SELECT
APPLICATION_ID, PARAM_LIST_CODE, 20 SEQUENCE_NUM, OBJECT_VERSION_NUMBER, PARAM_DEFN_APP_ID, PARAM_DEFN_CODE, 'P_ALTERNATE_ROUTING_DESIGNATOR' PARAM_NAME, ATTRIBUTE_APP_ID, 'CUXJIMP01_XINTG_UPL1_A20' ATTRIBUTE_CODE, STRING_VALUE, DATE_VALUE, NUMBER_VALUE, BOOLEAN_VALUE_FLAG, FORMULA_VALUE, DESC_VALUE, CREATED_BY, CREATION_DATE, LAST_UPDATED_BY, LAST_UPDATE_DATE, LAST_UPDATE_LOGIN, ZD_EDITION_NAME
FROM BNE_PARAM_LIST_ITEMS
WHERE 1 = 1
AND PARAM_NAME = 'P_COMMENTS'
AND PARAM_LIST_CODE LIKE 'CUXJIMP01_XINTG_UPL1%';


--INSERT PARAMETERS TO TABLE BNE_LAYOUT_COLS
INSERT INTO BNE_LAYOUT_COLS
SELECT
APPLICATION_ID, LAYOUT_CODE, BLOCK_ID, OBJECT_VERSION_NUMBER, INTERFACE_APP_ID, INTERFACE_CODE, 19 INTERFACE_SEQ_NUM, 190 SEQUENCE_NUM, STYLE, STYLE_CLASS, HINT_STYLE, HINT_STYLE_CLASS, PROMPT_STYLE, PROMPT_STYLE_CLASS, DEFAULT_TYPE, DEFAULT_VALUE, CREATED_BY, CREATION_DATE, LAST_UPDATED_BY, LAST_UPDATE_LOGIN, LAST_UPDATE_DATE, DISPLAY_WIDTH, READ_ONLY_FLAG, ZD_EDITION_NAME
FROM BNE_LAYOUT_COLS
WHERE 1 = 1
AND INTERFACE_SEQ_NUM = 18
AND INTERFACE_CODE = 'CUXJIMP01_XINTG_INTF1';


INSERT INTO BNE_LAYOUT_COLS
SELECT
APPLICATION_ID, LAYOUT_CODE, BLOCK_ID, OBJECT_VERSION_NUMBER, INTERFACE_APP_ID, INTERFACE_CODE, 20 INTERFACE_SEQ_NUM, 200 SEQUENCE_NUM, STYLE, STYLE_CLASS, HINT_STYLE, HINT_STYLE_CLASS, PROMPT_STYLE, PROMPT_STYLE_CLASS, DEFAULT_TYPE, DEFAULT_VALUE, CREATED_BY, CREATION_DATE, LAST_UPDATED_BY, LAST_UPDATE_LOGIN, LAST_UPDATE_DATE, DISPLAY_WIDTH, READ_ONLY_FLAG, ZD_EDITION_NAME
FROM BNE_LAYOUT_COLS
WHERE 1 = 1
AND INTERFACE_SEQ_NUM = 18
AND INTERFACE_CODE = 'CUXJIMP01_XINTG_INTF1';

--作完以上腳本處理,仍是要動桌面集成管理器職責,到界面上更新一下集成器接口功能,並更一下佈局,目的是將後臺的數據和前臺粘合初始化。

 

--alter session set nls_language='SIMPLIFIED CHINESE';--alter session set nls_language='AMERICAN';SELECT bni.application_id     , bni.integrator_code                                                                                                                                                                     --集成器code     , bni.user_name                                                                                                                                                                             --集成器名稱     , blv.layout_code                                                                                                                                                                            --佈局代碼     , blv.user_name                                                                                                                                                                            --佈局用戶名稱     , blc.sequence_num     , bic.*  FROM bne_integrators_vl bni     , bne_layouts_vl blv     , bne_layout_cols blc     , bne_interface_cols_vl bic WHERE bni.user_name LIKE 'CUXJIMP01%'       AND blv.integrator_app_id = bni.application_id       AND blv.integrator_code = bni.integrator_code       AND blv.layout_code = blc.layout_code       AND blc.interface_app_id = bic.application_id       AND blc.interface_code = bic.interface_code       AND blc.interface_seq_num = bic.sequence_num;

相關文章
相關標籤/搜索