(If applicable)
Other Text:
(Examples or comments displayed on slide, if any).
(If applicable)
Other Text:
(Examples or comments displayed on slide, if any).
(If applicable)
Other Text:
(Examples or comments displayed on slide, if any).
(If applicable)
Other Text:
(Examples or comments displayed on slide, if any).
SQLLDR parameters
C:\OracleScripts\DBA>sqlldr dave/dave control=emp.ctl
SQL*Loader: Release 9.2.0.1.0 - Production on Fri Oct 17 12:
Copyright (c) 1982, 2002, Oracle Corporation. All rights r
Commit point reached - logical record count 4
C:\OracleScripts\DBA>
Control file "EMP.CTL"
File to be loaded
LOAD DATA
INFILE 'emp.dat'
APPEND
INTO TABLE emp
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
(empno, lastname, firstname, salary)
(If applicable)
Other Text:
(Examples or comments displayed on slide, if any).
(If applicable)
Other Text:
(Examples or comments displayed on slide, if any).
LOAD DATA
INFILE emp.dat
APPEND
INTO TABLE emp
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
(empno, lastname, firstname, salary)
LOAD DATA
INFILE emp2.dat
BADFILE emp2.bad
INSERT INTO TABLE dave.emp2
FIELDS TERMINATED BY ","
OPTIONALLY ENCLOSED BY '"'
(empno, name,
hiredate DATE 'mm/dd/yyyy', salary)
Field description provides type and format of input data
(If applicable)
Other Text:
(Examples or comments displayed on slide, if any).
emp.dat
1,Belke,Gary,40000.00
2,Flanagan,Kevin,50000.00
3,Wiland,Geoff,45000.00
5,Wurtzel,Carl,45000.00
emp2.dat
1,"John Doe",04/14/97,23444.44
2,"Sue Smith",02/23/97,24433.33
(If applicable)
Other Text:
(Examples or comments displayed on slide, if any).
LOAD DATA
INFILE *
APPEND
INTO TABLE dave.emp
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
(emp_no, last_name, first_name, salary)
BEGINDATA
6,Anderson,Dave,40000.00
7,Flanagan,Kevin,50000.00
8,Virmani,Aashu,450000.00
9,Wurtzel,Carl,75000.00
(If applicable)
Other Text:
(Examples or comments displayed on slide, if any).
Start:End of field
Type of data in input record
LOAD DATA
INFILE emp3.dat
INTO TABLE dave.emp
(emp_no POSITION(01:01) INTEGER EXTERNAL,
last_name POSITION(03:10) CHAR,
first_name POSITION(12:16) CHAR,
salary POSITION(18:25) DECIMAL EXTERNAL)
*-*--------*-----*--------- <--[Marker for display only; remove for load]
1 Anderson Dave 44444.00
9 Flanagan Kevin 55555.00
(If applicable)
Other Text:
(Examples or comments displayed on slide, if any).
Control File: emp3.ctl
Data File: emp3.dat
Bad File: emp3.bad
Discard File: none specified (Allow all discards)
Number to load: ALL
Number to skip: 0
Errors allowed: 50
Record 1: Rejected - Error on table EMP.
ORA-00001: unique constraint (DAVE.SYS_C003740) violated
Record 2: Rejected - Error on table EMP.
ORA-00001: unique constraint (DAVE.SYS_C003740) violated
Table EMP:
0 Rows successfully loaded.
2 Rows not loaded due to data errors.
(If applicable)
Other Text:
(Examples or comments displayed on slide, if any).
LOAD DATA
INFILE emp.dat
DISCARDFILE emp.dis
INTO TABLE dave.emp
WHEN (3-5) = 'And'
(emp_no POSITION(01:01) INTEGER EXTERNAL,
last_name POSITION(03:10) CHAR,
first_name POSITION(12:16) CHAR,
salary POSITION(18:25) DECIMAL EXTERNAL)
Only records with AND in positions 3-5 are loaded
(If applicable)
Other Text:
(Examples or comments displayed on slide, if any).