CREATE TABLE admin_ext_employees
(employee_id NUMBER(4),
first_name VARCHAR2(20),
last_name VARCHAR2(25),
job_id VARCHAR2(10),
manager_id NUMBER(4),
hire_date DATE,
salary NUMBER(8,2),
commission_pct NUMBER(2,2),
department_id NUMBER(4),
email VARCHAR2(25)
)
ORGANIZATION EXTERNAL
(
TYPE ORACLE_LOADER
DEFAULT DIRECTORY admin_dat_dir
ACCESS PARAMETERS
(
records delimited by newline
badfile admin_bad_dir:'empxt%a_%p.bad'
logfile admin_log_dir:'empxt%a_%p.log'
fields terminated by ','
missing field values are null
( employee_id, first_name, last_name, job_id, manager_id,
hire_date char date_format date mask "dd-mon-yyyy",
salary, commission_pct, department_id, email
)
)
LOCATION ('empxt1.dat', 'empxt2.dat')
)
PARALLEL
REJECT LIMIT UNLIMITED;
--------------------------------------------------------------------------
yet one more example with non-default character set
CREATE TABLE domain_upl.kladr_orig_kladr_20141016
(
NAME VARCHAR2(100),
SOKR VARCHAR2(50),
CODE VARCHAR2(50),
IDX VARCHAR2(20),
GNONMB VARCHAR2(20),
UNO VARCHAR2(20),
OCATD VARCHAR2(30),
STATUS VARCHAR2(10)
)
ORGANIZATION EXTERNAL
(
TYPE ORACLE_LOADER
DEFAULT DIRECTORY DATA_PUMP_DIR1
ACCESS PARAMETERS
(
records delimited by newline CHARACTERSET CL8MSWIN1251
fields terminated by ','
missing field values are null
)
LOCATION ('KLADR-1251.csv')
)
PARALLEL
REJECT LIMIT UNLIMITED;
list of character sets supported by the database may be output as
SELECT UNIQUE VALUE FROM V$NLS_VALID_VALUES WHERE PARAMETER ='CHARACTERSET'
CREATE TABLE dns_zone
(
owner_name varchar2(1000),
ttl varchar2(100),
protocol varchar2(100),
record_type varchar2(100),
text varchar2(1000)
)
ORGANIZATION EXTERNAL
(
TYPE ORACLE_LOADER
DEFAULT DIRECTORY DATA_PUMP_DIR1
ACCESS PARAMETERS
(
records delimited by newline
fields terminated by whitespace
(owner_name, ttl, protocol, record_type, text)
)
LOCATION ('myfile')
)
REJECT LIMIT UNLIMITED;
|