Pages

Monday, May 15, 2017

SQL * Loader in Oracle Apps

SQL* LOADER (sqlldr) is a utility which is used to load the data form flat files to
table. We have to feed control file to the sql loader this control file contains the information
about the flat file and which table needs to be loaded.

We have two methods of dataloading in SQL loader
Direct Data Loading
Conventional Data Loading

Sql Loader Syntax

Options (Skip =1 ; direct = true; filler = 1)
load data
infile "C:\sqlldr.data"
insert into emp_details
fields terminated by "," optionally enclosed by '"'
(Empno "db_sq.nextval"
,vempnot SEQUENCE(MAX ,1 )
,ename "decode(:ename,null,'Company',:ename)"
,sal constant '1200'
,comm
,deptno
,mgr
,hiredate date(20) "dd-Month-yyyy")

Files involved in SQL * Loader
- Data file ( can be .csv, .dat, .txt)
- Control file
- Bad file
- Discard file
- Log file

Methods to Insert Data
-Insert
-Replace
-Truncate
-Append

No comments:

Post a Comment