BEGIN
  FOR l_rec IN (SELECT 1
                  FROM user_tables
                 WHERE table_name = 'EXT_METERS') LOOP
    EXECUTE IMMEDIATE 'DROP TABLE ext_meters';
  END LOOP;
END;
/
create table ext_meters
(
  code  varchar2(240),
  drwg_code  varchar2(240),
  mety_code  varchar2(240),
  manu_ref  varchar2(240),
  dim_a  varchar2(240),
  dim_b  varchar2(240),
  centres  varchar2(240),
  dim_c  varchar2(240),
  weight  varchar2(240),
  qmax varchar2(240),
  valid_from varchar2(240),
  valid_to varchar2(240),
  qnom varchar2(240),
  qmin 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,
  drwg_code,
  mety_code,
  manu_ref,
  dim_a,
  dim_b,
  centres,
  dim_c,
  weight,
  qmax,
  valid_from,
  valid_to,
  qnom,
  qmin
  )
)
location ('METERS.csv')
)
reject limit unlimited
/
