External Tables and SQL loader
External Tables and SQL loader
TABLES &
SQL LOADER.
SQL Loader is a bulk loader utility used for moving data from external files
into the Oracle database. The external tables feature is a complement to
existing SQL Loader functionality which helps you to access data from
external sources.
EXTERNAL TABLES AND SQL LOADER.
External tables allow Oracle to query data that is stored outside the database in flat files. The
ORACLE_LOADER driver can be used to access any data stored in any format that can be
loaded by SQL*Loader. No DML can be performed on external tables but they can be used for
query, join and sort operations.
John
Alice
Philip
Russel
EXTERNAL TABLES AND SQL LOADER.
SQL*Loader is a bulk loader utility used for moving data from external files into the Oracle
database.
Records read from the input file might not be inserted into the database. Such records are
placed in either a bad file or a discard file.
Bad file:
Datafile records are rejected by SQL Loader when the input format is invalid. The bad file
contains rows that were rejected because of errors. These errors might include bad datatypes
or referential integrity constraints. For example, if the second enclosure delimiter is missing,
or if a delimited field exceeds its maximum length, SQL Loader rejects the record. Rejected
records are placed in the bad file.
Discard file:
The discard file contains rows that were discarded because they were filtered out because of a
statement in the SQL Loader control file.
EXTERNAL TABLES AND SQL LOADER.
SQL LOADER:
EMP_ID NUMBER(5),
EMP_NAME VARCHAR2(30),
EMP_DEPT VARCHAR2(20));
###########Control File######
LOAD DATA
INFILE *
REPLACE
EMP_ID ,
EMP_NAME ,
EMP_DEPT )
##########data.dat##########
1,Chivas,Grant
2,Scott,Tiger
3,Peter,Russel
##########################