Oracle – Import data from CSV file using SQL Loader

In this post we will see how we can transfer the data from CSV to oracle database using SQL Loader.

SQL Loader is a bulk loader utility used for moving data from external files into the Oracle database.

One can use SQL Loader utility to transfer the data for high performance.

Syntax:

sqlldr username@server/password control=control_file.ctl

sqlldr username/password@server control= control_file.ctl

Exmaple:

Let‘s take a CSV file named as test_data.csv

Import data from a CSV file using SQL Loader

Import data from a CSV file using SQL Loader

First we need to create a table where we want to transfer the data. So here created a table named as employee

 Import data from a CSV file using SQL Loader

Import data from a CSV file using SQL Loader

Here we created a Control file as

Import data from a CSV file using SQL Loader

Import data from a CSV file using SQL Loader

Now from the Command Prompt, we execute the SQL Loader Utility as

Note: Test_data.ctl and test_data.csv file placed at Location D:\Test Data

 Import data from a CSV file using SQL Loader

Import data from a CSV file using SQL Loader

So test_data.csv data is tranferred in the employee table.

Import data from a CSV file using SQL Loader

Import data from a CSV file using SQL Loader

If you have any suggestion/comment, please share.

2 comments