Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
==============
SQL*Loader to perform tasks such as:
=====================================
1) Loading data from multiple data files into multiple tables
2) Control various aspects of the load operation
3) Use either conventional or direct path loading
When skip option is not mentioned in the control file, even though the header of the input CSV file will
be rejected and sent to bad file as it’s not the same file format of the stage table.
If skip is mentioned then there won’t be any rejected columns in the bad file.
Skip we can mention also in the CMD prompt.
If insert or append or replace is not mentioned in the CTL, then by default it will do the insert option.
If we are appending the same record which are already available in the database, then append won’t
work.
We need to mention the keyword position while loading with fixed with data format.
When uploading data into tables from single flat file, if we are appending, then if any one of the two
tables is already having the same data, appending won’t happen for the two tables itself.
When truncating data from two database tables and if any one of the table is already empty then
truncate won’t happen for the two tables itself.
Bad file :
===========
contain the rejected records which are not uploaded into the database due to any error
in records(like wrong datatype)
Discard file :
===============
contain the discarded records which doesn't meet the when condition and not uploaded
into the database. If no records are discarded then discard file is not created.
To create a discard file from within a control file, specify any of the following:
DISCARDFILE filename, DISCARDDN filename (DB2), DISCARDS, or DISCARDMAX.
To create a discard file from the command line, specify either DISCARD or DISCARDMAX.
The discard file is created in the same record and file format as the datafile
EXAMPLE:
==========
control.ctl:
=============
load data
infile 'C:\Users\GIRI\Desktop\selva\dept.csv'
append
into table dept_v
(
dept_no position(1:2)
,dept_name position(3:9)
)