Sunday, 12 April 2026

Loading student details using Oracle SQL*Loader

 

SQL* Loader

                          POC done by Raghava

 

SQL *Loader is used to import/Load the Bulk/Large External Data which available in csv/txt.. files in Oracle Database tables

Here there is Flat File Which Contain Raw Data and is classified into 2 Types:

  1.Fixed Length

  2.Variable Length

1.Fixed Length:-

             In fixed length the data in each record has the exact same number of Size(bytes or characters), regardless of the  content.

                                              Ex:-101Arjun8578

                                              It can be easily Readable by Sql loader

2.Variable Length: -

                              In Variable length the data in each record has the Different Size Depending On Records Available   

                     The Values are Separated by the Comma/Pipe Symbols

                                             Ex: -101, Arjun,85,78              

                                                                          

------------------Steps To Load the data By the Star Loader------------------

Here  we r using Variable data to load the data

1.Create a Table with Structure without Data

2.Take the data file which Consists of Data

  save the file with extension .txt

3.Take another file with Extension of ctl(control file)

  In Control File We write Like 

    load Data

    infile "G:\Oracle Fusion\Documents\star_loader.txt"

    insert

    into table xx_student_details

    fields Terminated by ','

    Optionally Enclosed By '"'

    TRAILING NULLCOLS

    (Name,Class_Id,Student_Id,Location)

SAVE THE FILE WITH extension .ctl

 

4. Open the Command Prompt and select as Run As Adminsitrator  

   In the commad Prompt we write --------->sqldlr  userid=system/system Click Enter

   


  

5 then we get Control=



 

 

6. here we have to paste the ctl file path

  click Enter we  Get



Count 3 is total Count of records in the Table

 select *from xx_student_details;

  


 

No comments: