Can Oracle SQL*Loader work without a control file

883 Views Asked by At

I am using SQL*Loader to push lot of CSV files to Oracle database. I am building intelligence using JAVA to create control file's content. Reason is That the nature of data is such that the control file's content changes with every CSV file i get. Or atleast i have to open the control file and perform few checks. I want to save the cost of creating, opening and other costs associated with the file I/O operation. I want to maintain the control file information in memory and and provide that data structure to SQL*Loader command instead of specifying the Control file.

1

There are 1 best solutions below

0
On

SQL*Loader is the wrong tool for the job. It is designed for repeatable loads. Clearly that's not what you're doing.

"I want to save the cost of creating, opening and other costs associated with the file I/O operation."

And your benchmark for this onerous cost is ... ????

Anyway, if you really want to load from a different file structure each time you need something which can read the file header and generate a dynamic SQL statement for loading the rest of the file's content.

Personally I would choose top use PL/SQL for this, providing I could get the file on to the database server. If I had to load it from the client then maybe a Java program would be the answer. However, transferring the file's content across the network remains the real I/O cost. Getting it delivered to the right server is the best saving on offer in this scenario.