Friday, January 31, 2014

SQL loader


DROP DIRECTORY emp_dir;

--
-- emp_dir (Directory)
--
CREATE OR REPLACE DIRECTORY
emp_dir AS
'G:\FLAT_FILES';

GRANT READ, WRITE ON DIRECTORY emp_dir TO SCOTT WITH GRANT OPTION;



CREATE TABLE oldemp (
empno NUMBER,empname CHAR(20),birthdate DATE)
ORGANIZATION EXTERNAL
(TYPE ORACLE_LOADER
DEFAULT DIRECTORY emp_dir
ACCESS PARAMETERS
(RECORDS DELIMITED BY NEWLINE
BADFILE 'bad_emp'
LOGFILE 'log_emp'
FIELDS terminated by ','
(empno CHAR,
empname CHAR,
birthdate CHAR date_format date mask "dd-mon-yyyy"))
LOCATION ('emp1.txt'))
PARALLEL 5
REJECT LIMIT 200;


No comments:

Post a Comment