WEB ADI 修改列标题和增加LOV的SQL语句

DECLARE
  l_app_id NUMBER;
  l_inf_code VARCHAR2(30);
BEGIN

  SELECT inf.APPLICATION_ID,inf.INTERFACE_CODE
  INTO l_app_id,l_inf_code
  FROM   bne_integrators_vl bni
        ,bne_interfaces_vl  inf
  WHERE  bni.application_id = inf.integrator_app_id
  AND    bni.integrator_code = inf.integrator_code
  AND    bni.user_name = 'CRC_B17_AR_收款导入_ADI_2';
 
  --库存组织LOV
  BNE_INTEGRATOR_UTILS.CREATE_TABLE_LOV                                   --
    (P_APPLICATION_ID       => l_app_id,                                       --
     P_INTERFACE_CODE       => l_inf_code,                            --
     P_INTERFACE_COL_NAME   => 'P_ORG_NAME',                                --
     P_ID_COL               => 'NAME', -- LOOKUP CODE UPLOADED     --
     P_MEAN_COL             => 'NAME',     -- Shown in sheet           --
     P_DESC_COL             => 'COMMENTS',                             --
     P_TABLE                => 'HR_ORGANIZATION_UNITS',                             --
     P_ADDL_W_C             => 'ORGANIZATION_ID IN ( SELECT hoi.organization_id
                                FROM hr_organization_information hoi
                                WHERE hoi.org_information1 = ''INV'')',
      P_WINDOW_CAPTION       => '库存组织',--
      P_WINDOW_WIDTH         => 400,                                       --
      P_WINDOW_HEIGHT        => 300,                                       --
      P_TABLE_BLOCK_SIZE     => 10,                                        --
      P_TABLE_SORT_ORDER     => 'yes', -- sortable by meaning, not description--
     P_USER_ID              => 2,
     P_TABLE_COLUMNS        => 'NAME,COMMENTS',
     P_TABLE_HEADERS        => '名称,说明'
     );


  --档次LOV
  BNE_INTEGRATOR_UTILS.CREATE_TABLE_LOV                                   --
    (P_APPLICATION_ID       => l_app_id,                                       --
     P_INTERFACE_CODE       => l_inf_code,                            --
     P_INTERFACE_COL_NAME   => 'P_ATTRIBUTE6',                                --
     P_ID_COL               => 'FLEX_VALUE', -- LOOKUP CODE UPLOADED     --
     P_MEAN_COL             => 'FLEX_VALUE',     -- Shown in sheet           --
     P_DESC_COL             => 'DESCRIPTION',                             --
     P_TABLE                => 'fnd_flex_values_vl',                             --
     P_ADDL_W_C             => 'ENABLED_FLAG = ''Y''
                                AND nvl(END_DATE_ACTIVE,SYSDATE + 1) > SYSDATE
                                AND FLEX_VALUE_SET_ID = ( SELECT s.flex_value_set_id
                                FROM fnd_flex_value_sets s
                                WHERE s.flex_value_set_name = ''CUX_LOV_Level'')',
      P_WINDOW_CAPTION       => '档次',--
      P_WINDOW_WIDTH         => 400,                                       --
      P_WINDOW_HEIGHT        => 300,                                       --
      P_TABLE_BLOCK_SIZE     => 10,                                        --
      P_TABLE_SORT_ORDER     => 'yes', -- sortable by meaning, not description--
     P_USER_ID              => 2,
     P_TABLE_COLUMNS        => 'FLEX_VALUE,DESCRIPTION',
     P_TABLE_HEADERS        => '名称,说明'
     );

  --采用综合单价LOV
  BNE_INTEGRATOR_UTILS.CREATE_TABLE_LOV                                   --
    (P_APPLICATION_ID       => l_app_id,                                       --
     P_INTERFACE_CODE       => l_inf_code,                            --
     P_INTERFACE_COL_NAME   => 'P_ATTRIBUTE7',                                --
     P_ID_COL               => 'LOOKUP_CODE', -- LOOKUP CODE UPLOADED     --
     P_MEAN_COL             => 'MEANING',     -- Shown in sheet           --
     P_DESC_COL             => 'MEANING',                             --
     P_TABLE                => 'FND_LOOKUPS',                             --
     P_ADDL_W_C             => 'LOOKUP_TYPE = ''YES_NO''',
      P_WINDOW_CAPTION       => '采用综合单价',--
      P_WINDOW_WIDTH         => 400,                                       --
      P_WINDOW_HEIGHT        => 300,                                       --
      P_TABLE_BLOCK_SIZE     => 10,                                        --
      P_TABLE_SORT_ORDER     => 'yes', -- sortable by meaning, not description--
     P_USER_ID              => 2,
     P_TABLE_COLUMNS        => 'MEANING,DESCRIPTION',
     P_TABLE_HEADERS        => '标识,说明'
     );

  --建安、其他费LOV
  BNE_INTEGRATOR_UTILS.CREATE_TABLE_LOV                                   --
    (P_APPLICATION_ID       => l_app_id,                                       --
     P_INTERFACE_CODE       => l_inf_code,                            --
     P_INTERFACE_COL_NAME   => 'P_ATTRIBUTE8',                                --
     P_ID_COL               => 'FLEX_VALUE', -- LOOKUP CODE UPLOADED     --
     P_MEAN_COL             => 'FLEX_VALUE',     -- Shown in sheet           --
     P_DESC_COL             => 'DESCRIPTION',                             --
     P_TABLE                => 'fnd_flex_values_vl',                             --
     P_ADDL_W_C             => 'ENABLED_FLAG = ''Y''
                                AND nvl(END_DATE_ACTIVE,SYSDATE + 1) > SYSDATE
                                AND FLEX_VALUE_SET_ID = ( SELECT s.flex_value_set_id
                                FROM fnd_flex_value_sets s
                                WHERE s.flex_value_set_name = ''CUX_LOV_Fee_Type'')',
      P_WINDOW_CAPTION       => '建安/其他费',--
      P_WINDOW_WIDTH         => 400,                                       --
      P_WINDOW_HEIGHT        => 300,                                       --
      P_TABLE_BLOCK_SIZE     => 10,                                        --
      P_TABLE_SORT_ORDER     => 'yes', -- sortable by meaning, not description--
     P_USER_ID              => 2,
     P_TABLE_COLUMNS        => 'FLEX_VALUE,DESCRIPTION',
     P_TABLE_HEADERS        => '名称,说明'
     );
    
  --计价方式LOV
  BNE_INTEGRATOR_UTILS.CREATE_TABLE_LOV                                   --
    (P_APPLICATION_ID       => l_app_id,                                       --
     P_INTERFACE_CODE       => l_inf_code,                            --
     P_INTERFACE_COL_NAME   => 'P_ATTRIBUTE9',                                --
     P_ID_COL               => 'FLEX_VALUE', -- LOOKUP CODE UPLOADED     --
     P_MEAN_COL             => 'FLEX_VALUE',     -- Shown in sheet           --
     P_DESC_COL             => 'DESCRIPTION',                             --
     P_TABLE                => 'fnd_flex_values_vl',                             --
     P_ADDL_W_C             => 'ENABLED_FLAG = ''Y''
                                AND nvl(END_DATE_ACTIVE,SYSDATE + 1) > SYSDATE
                                AND FLEX_VALUE_SET_ID = ( SELECT s.flex_value_set_id
                                FROM fnd_flex_value_sets s
                                WHERE s.flex_value_set_name = ''CUX_LOV_Price_Type'')',
      P_WINDOW_CAPTION       => '计价方式',--
      P_WINDOW_WIDTH         => 400,                                       --
      P_WINDOW_HEIGHT        => 300,                                       --
      P_TABLE_BLOCK_SIZE     => 10,                                        --
      P_TABLE_SORT_ORDER     => 'yes', -- sortable by meaning, not description--
     P_USER_ID              => 2,
     P_TABLE_COLUMNS        => 'FLEX_VALUE,DESCRIPTION',
     P_TABLE_HEADERS        => '名称,说明'
     );

  --模板LOV
  BNE_INTEGRATOR_UTILS.CREATE_TABLE_LOV                                   --
    (P_APPLICATION_ID       => l_app_id,                                       --
     P_INTERFACE_CODE       => l_inf_code,                            --
     P_INTERFACE_COL_NAME   => 'P_TEMPLATE',                                --
     P_ID_COL               => 'TEMPLATE_NAME', -- LOOKUP CODE UPLOADED     --
     P_MEAN_COL             => 'TEMPLATE_NAME',     -- Shown in sheet           --
     P_DESC_COL             => 'DESCRIPTION',                             --
     P_TABLE                => 'mtl_item_templates_vl',                             --
     P_ADDL_W_C             => '',
      P_WINDOW_CAPTION       => '模板',--
      P_WINDOW_WIDTH         => 400,                                       --
      P_WINDOW_HEIGHT        => 300,                                       --
      P_TABLE_BLOCK_SIZE     => 10,                                        --
      P_TABLE_SORT_ORDER     => 'yes', -- sortable by meaning, not description--
     P_USER_ID              => 2,
     P_TABLE_COLUMNS        => 'TEMPLATE_NAME,DESCRIPTION',
     P_TABLE_HEADERS        => '名称,说明'
     );

  --专业LOV
  BNE_INTEGRATOR_UTILS.CREATE_TABLE_LOV                                   --
    (P_APPLICATION_ID       => l_app_id,                                       --
     P_INTERFACE_CODE       => l_inf_code,                            --
     P_INTERFACE_COL_NAME   => 'P_EXT_ATT1',                                --
     P_ID_COL               => 'LOOKUP_CODE', -- LOOKUP CODE UPLOADED     --
     P_MEAN_COL             => 'MEANING',     -- Shown in sheet           --
     P_DESC_COL             => 'DESCRIPTION',                             --
     P_TABLE                => 'FND_LOOKUP_VALUES',                             --
     P_ADDL_W_C             => 'LANGUAGE = userenv(''LANG'')
                                AND    ENABLED_FLAG = ''Y''
                                AND    lookup_type = ''EMPLOYEE_CATG''
                                AND    VIEW_APPLICATION_ID = 3
                                AND    SECURITY_GROUP_ID = 0',
      P_WINDOW_CAPTION       => '专业',--
      P_WINDOW_WIDTH         => 400,                                       --
      P_WINDOW_HEIGHT        => 300,                                       --
      P_TABLE_BLOCK_SIZE     => 10,                                        --
      P_TABLE_SORT_ORDER     => 'yes', -- sortable by meaning, not description--
     P_USER_ID              => 2,
     P_TABLE_COLUMNS        => 'MEANING,DESCRIPTION',
     P_TABLE_HEADERS        => '名称,说明'
     );

  --经济技术指标分类LOV
  BNE_INTEGRATOR_UTILS.CREATE_TABLE_LOV                                   --
    (P_APPLICATION_ID       => l_app_id,                                       --
     P_INTERFACE_CODE       => l_inf_code,                            --
     P_INTERFACE_COL_NAME   => 'P_EXT_ATT4',                                --
     P_ID_COL               => 'FLEX_VALUE', -- LOOKUP CODE UPLOADED     --
     P_MEAN_COL             => 'FLEX_VALUE',     -- Shown in sheet           --
     P_DESC_COL             => 'DESCRIPTION',                             --
     P_TABLE                => 'fnd_flex_values_vl',                             --
     P_ADDL_W_C             => 'ENABLED_FLAG = ''Y''
                                AND nvl(END_DATE_ACTIVE,SYSDATE + 1) > SYSDATE
                                AND FLEX_VALUE_SET_ID = ( SELECT s.flex_value_set_id
                                FROM fnd_flex_value_sets s
                                WHERE s.flex_value_set_name = ''CUX_LOV_Economic_Type'')',
      P_WINDOW_CAPTION       => '分类',--
      P_WINDOW_WIDTH         => 400,                                       --
      P_WINDOW_HEIGHT        => 300,                                       --
      P_TABLE_BLOCK_SIZE     => 10,                                        --
      P_TABLE_SORT_ORDER     => 'yes', -- sortable by meaning, not description--
     P_USER_ID              => 2,
     P_TABLE_COLUMNS        => 'FLEX_VALUE,DESCRIPTION',
     P_TABLE_HEADERS        => '名称,说明'
    );

 


  --修改标题
  UPDATE bne_interface_cols_vl inc
  SET    inc.prompt_left  = '物料编码'
        ,inc.prompt_above = '物料编码'
  WHERE  inc.interface_col_name = 'P_ITEM_CODE'
  AND    inc.APPLICATION_ID = l_app_id
  AND    inc.INTERFACE_CODE = l_inf_code;
 
  UPDATE bne_interface_cols_vl inc
  SET    inc.prompt_left  = '物料说明'
        ,inc.prompt_above = '物料说明'
  WHERE  inc.interface_col_name = 'P_ITEM_DESC'
  AND    inc.APPLICATION_ID = l_app_id
  AND    inc.INTERFACE_CODE = l_inf_code;

  UPDATE bne_interface_cols_vl inc
  SET    inc.prompt_left  = '详细说明'
        ,inc.prompt_above = '详细说明'
  WHERE  inc.interface_col_name = 'P_ITEM_LONG_DESC'
  AND    inc.APPLICATION_ID = l_app_id
  AND    inc.INTERFACE_CODE = l_inf_code;
 
  UPDATE bne_interface_cols_vl inc
  SET    inc.prompt_left  = '单位'
        ,inc.prompt_above = '单位'
  WHERE  inc.interface_col_name = 'P_UOM'
  AND    inc.APPLICATION_ID = l_app_id
  AND    inc.INTERFACE_CODE = l_inf_code;
 
  UPDATE bne_interface_cols_vl inc
  SET    inc.prompt_left  = '重量单位'
        ,inc.prompt_above = '重量单位'
  WHERE  inc.interface_col_name = 'P_WEIGHT_UOM'
  AND    inc.APPLICATION_ID = l_app_id
  AND    inc.INTERFACE_CODE = l_inf_code;
 
  UPDATE bne_interface_cols_vl inc
  SET    inc.prompt_left  = '单位重量'
        ,inc.prompt_above = '单位重量'
  WHERE  inc.interface_col_name = 'P_UNIT_WEIGHT'
  AND    inc.APPLICATION_ID = l_app_id
  AND    inc.INTERFACE_CODE = l_inf_code;
 
  UPDATE bne_interface_cols_vl inc
  SET    inc.prompt_left  = '类别'
        ,inc.prompt_above = '类别'
  WHERE  inc.interface_col_name = 'P_CATA'
  AND    inc.APPLICATION_ID = l_app_id
  AND    inc.INTERFACE_CODE = l_inf_code;
 
  UPDATE bne_interface_cols_vl inc
  SET    inc.prompt_left  = '品种'
        ,inc.prompt_above = '品种'
  WHERE  inc.interface_col_name = 'P_GATTR1'
  AND    inc.APPLICATION_ID = l_app_id
  AND    inc.INTERFACE_CODE = l_inf_code;
 
  UPDATE bne_interface_cols_vl inc
  SET    inc.prompt_left  = '模板'
        ,inc.prompt_above = '模板'
  WHERE  inc.interface_col_name = 'P_TEMPLATE'
  AND    inc.APPLICATION_ID = l_app_id
  AND    inc.INTERFACE_CODE = l_inf_code;
 
  UPDATE bne_interface_cols_vl inc
  SET    inc.prompt_left  = '库存组织'
        ,inc.prompt_above = '库存组织'
  WHERE  inc.interface_col_name = 'P_ORG_NAME'
  AND    inc.APPLICATION_ID = l_app_id
  AND    inc.INTERFACE_CODE = l_inf_code;
 
  UPDATE bne_interface_cols_vl inc
  SET    inc.prompt_left  = '档次'
        ,inc.prompt_above = '档次'
  WHERE  inc.interface_col_name = 'P_ATTRIBUTE6'
  AND    inc.APPLICATION_ID = l_app_id
  AND    inc.INTERFACE_CODE = l_inf_code;
 
  UPDATE bne_interface_cols_vl inc
  SET    inc.prompt_left  = '采用综合单价'
        ,inc.prompt_above = '采用综合单价'
  WHERE  inc.interface_col_name = 'P_ATTRIBUTE7'
  AND    inc.APPLICATION_ID = l_app_id
  AND    inc.INTERFACE_CODE = l_inf_code;
 
  UPDATE bne_interface_cols_vl inc
  SET    inc.prompt_left  = '建安费/其它费'
        ,inc.prompt_above = '建安费/其它费'
  WHERE  inc.interface_col_name = 'P_ATTRIBUTE8'
  AND    inc.APPLICATION_ID = l_app_id
  AND    inc.INTERFACE_CODE = l_inf_code;
 
  UPDATE bne_interface_cols_vl inc
  SET    inc.prompt_left  = '计价方式'
        ,inc.prompt_above = '计价方式'
  WHERE  inc.interface_col_name = 'P_ATTRIBUTE9'
  AND    inc.APPLICATION_ID = l_app_id
  AND    inc.INTERFACE_CODE = l_inf_code;
 
  UPDATE bne_interface_cols_vl inc
  SET    inc.prompt_left  = '专业'
        ,inc.prompt_above = '专业'
  WHERE  inc.interface_col_name = 'P_EXT_ATT1'
  AND    inc.APPLICATION_ID = l_app_id
  AND    inc.INTERFACE_CODE = l_inf_code;
 
  UPDATE bne_interface_cols_vl inc
  SET    inc.prompt_left  = '名称'
        ,inc.prompt_above = '名称'
  WHERE  inc.interface_col_name = 'P_EXT_ATT2'
  AND    inc.APPLICATION_ID = l_app_id
  AND    inc.INTERFACE_CODE = l_inf_code;
 
  UPDATE bne_interface_cols_vl inc
  SET    inc.prompt_left  = '规格'
        ,inc.prompt_above = '规格'
  WHERE  inc.interface_col_name = 'P_EXT_ATT3'
  AND    inc.APPLICATION_ID = l_app_id
  AND    inc.INTERFACE_CODE = l_inf_code;
 
  UPDATE bne_interface_cols_vl inc
  SET    inc.prompt_left  = '经济技术指标分类'
        ,inc.prompt_above = '经济技术指标分类'
  WHERE  inc.interface_col_name = 'P_EXT_ATT4'
  AND    inc.APPLICATION_ID = l_app_id
  AND    inc.INTERFACE_CODE = l_inf_code;
 
  UPDATE bne_interface_cols_vl inc
  SET    inc.prompt_left  = '材质'
        ,inc.prompt_above = '材质'
  WHERE  inc.interface_col_name = 'P_EXT_ATT5'
  AND    inc.APPLICATION_ID = l_app_id
  AND    inc.INTERFACE_CODE = l_inf_code;
 
  UPDATE bne_interface_cols_vl inc
  SET    inc.prompt_left  = '型号图号'
        ,inc.prompt_above = '型号图号'
  WHERE  inc.interface_col_name = 'P_EXT_ATT6'
  AND    inc.APPLICATION_ID = l_app_id
  AND    inc.INTERFACE_CODE = l_inf_code;
 
  UPDATE bne_interface_cols_vl inc
  SET    inc.prompt_left  = '装置'
        ,inc.prompt_above = '装置'
  WHERE  inc.interface_col_name = 'P_EXT_ATT7'
  AND    inc.APPLICATION_ID = l_app_id
  AND    inc.INTERFACE_CODE = l_inf_code;
 
  UPDATE bne_interface_cols_vl inc
  SET    inc.prompt_left  = '工程类别'
        ,inc.prompt_above = '工程类别'
  WHERE  inc.interface_col_name = 'P_EXT_ATT8'
  AND    inc.APPLICATION_ID = l_app_id
  AND    inc.INTERFACE_CODE = l_inf_code;
 
END;

 

 

--查询LOV是否注册上去
select * from bne_interface_cols_vl where interface_code='GENERAL_141_INTF'

 

你可能感兴趣的:(sql,Web,Flex,table,application,interface)