Search This Blog

Wednesday, December 16, 2015

SQL Loader

SQL*Loader loads data from external files into tables of an Oracle database.

Under scott user we have a table called DEPT.  We will try to load data from a sample text file to dept table.

Create a sample datafile at OS level.

dept.dat
50,dept50,delhi
60,dept60,hyd


Create a control file based on dept table and data file.

dept.ctl

LOAD DATA
INFILE '/home/oracle/dmp/dept.dat'
INTO TABLE dept
APPEND
FIELDS TERMINATED BY ","
(deptno,dname,loc)

Invoke the SQL*Loader

sqlldr userid=scott/tiger control=dept.ctl log=dept.log


No comments:

Post a Comment