21.12.17

SQL*Loader

SQL*Loader



What is this?

SQL*Loader loads data to an oracle database.With the help of SQL*Loader you can load data from external files to Oracle database. With the powerful data parsing engine that puts little limitation on the format of the data in the datafile.

Below key points taken from Oracle documention:-

1. Load data across a network. This means that you can run the SQL*Loader client on a different system from the one that is running the SQL*Loader server.

2. Load data from multiple datafiles during the same load session.

3. Load data into multiple tables during the same load session.

4. Specify the character set of the data.

5. Selectively load data (you can load records based on the records' values).

6. Manipulate the data before loading it, using SQL functions.

7. Generate unique sequential key values in specified columns.

8. Use the operating system's file system to access the datafiles.

9. Load data from disk, tape, or named pipe.

10. Generate sophisticated error reports, which greatly aid troubleshooting.

11. Load arbitrarily complex object-relational data.

12. Use secondary datafiles for loading LOBs and collections.


Example to load data in fixed format:- 

load data
infile 'test.dat'  "fix 12"
into table test
fields terminated by ',' optionally enclosed by '"'
(col_1, col_2)

example.dat:
007,   cd, 0008,fghi,
00009,lmn,
1, "pqrs",
0010,uvwx,