BEGIN
  FOR l_rec IN (SELECT 1
                  FROM user_tables
                 WHERE table_name = 'EXT_MODULES') LOOP
    EXECUTE IMMEDIATE 'DROP TABLE ext_modules';
  END LOOP;
END;
/
CREATE TABLE ext_modules(
    code VARCHAR2(240)
    ,outlet_cnty_code VARCHAR2(240)
    ,inlet_cnty_code VARCHAR2(240)
    ,drwg_code VARCHAR2(240)
    ,metr_code VARCHAR2(240)
    ,reva_code VARCHAR2(240)
    ,slva_code VARCHAR2(240)
    ,svcp_code VARCHAR2(240)
    ,weight VARCHAR2(240)
    ,inlet_height VARCHAR2(240)
    ,inlet_size VARCHAR2(240)
    ,outlet_pressure VARCHAR2(240)
    ,outlet_height VARCHAR2(240)
    ,outlet_size VARCHAR2(240)
    ,bas_code VARCHAR2(240)
    ,hou_code VARCHAR2(240)
    ,dim_a VARCHAR2(240)
    ,dim_b VARCHAR2(240)
    ,dim_c VARCHAR2(240)
    ,dim_d VARCHAR2(240)
    ,dim_e VARCHAR2(240)
    ,dim_f VARCHAR2(240)
    ,dim_h VARCHAR2(240)
    ,valid_from VARCHAR2(240)
    ,valid_to VARCHAR2(240)
    ,regu_code VARCHAR2(240)
    ,fltr_code VARCHAR2(240)
    ,inlet_cnor_code VARCHAR2(240)
    ,outlet_cnor_code VARCHAR2(240)
    ,lead_time VARCHAR2(240)
    ,manu_ref VARCHAR2(240)
    ,qmax varchar2(240)) organization EXTERNAL
(TYPE oracle_loader 
DEFAULT DIRECTORY webmip_bulk_load
ACCESS PARAMETERS(
  records
  delimited BY
  newline
  readsize
  10485760 skip 1
  fields
  terminated BY ','
  optionally
  enclosed BY '"'
  missing
  field
  VALUES are
  NULL(
  code
  ,outlet_cnty_code
  ,inlet_cnty_code
  ,drwg_code
  ,metr_code
  ,reva_code
  ,slva_code
  ,svcp_code
  ,weight
  ,inlet_height
  ,inlet_size
  ,outlet_pressure
  ,outlet_height
  ,outlet_size
  ,bas_code
  ,hou_code
  ,dim_a
  ,dim_b
  ,dim_c
  ,dim_d
  ,dim_e
  ,dim_f
  ,dim_h
  ,valid_from
  ,valid_to
  ,regu_code
  ,fltr_code
  ,inlet_cnor_code
  ,outlet_cnor_code
  ,lead_time
  ,manu_ref
  ,qmax)
  )
location('MODULES.csv')) reject LIMIT unlimited 
/
