Overview 

SQL Loader is a bulk loader utility to load data from a flat file to an Oracle Table. It is used for high performance data loading.

1. Technologies and Tools Used

The following technologies has been used to achieve the same.

  • SQLPLUS
  • SQL

2. Use Case

Consider you have been given a task to upload a large number of data into a table. Uploading the data using usual “Insert” statements would consume more and more time considering the quantity of the data. In such scenarios we can perform the same in quick time using SQL Loader. The below explained method will help you to achieve the same. Here we are taking Course details as an example.

3. Architecture 

Following steps explains in detail,

Step 1:  Creating the table in which the data has to be inserted.

Create table Course_details

(Course_id number,

Course_name varchar2(25));

 

Step 2:  Open a new text document and enter the data to be inserted as entered below:

Step 3:  Saving the file in .csv format.

Step 4:  Open another new text document and enter the below code:

load data infile ‘C:\Users\admin\Desktop\SQL Loader\Courses.csv’

append into table Course_details

fields terminated by ‘,’

(course_id,course_name)

Step 5:  Saving the above text document as a control (.ctl) file

Step 6: Now open command prompt and login as sqlldr.

Step 7: Paste the file directory of the control file as below:

Once we provide the control file directory the records will get inserted into the table.

 

4. Conclusion 

Therefore, adding a lot of data to a table is made simple, which aids in high performance data loading.

Recent Posts

Start typing and press Enter to search