Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback, please email oracle-forums_moderators_us@oracle.com

SQL LOADER with less fields in data file.

User_CS62GOct 21 2021

Hello,
I have a scenario to implement where in I have 10 columns in a table which has to be loaded in APPEND mode, i.e. the table already has records and we have to insert new records into it.
In data file we are only getting 8 columns data as the first 2 columns which are NOT NULL will contain constant values as 'CONS' & SYSDATE for every record to be inserted. Data file contains data from 3 column.
Now the requirement is to generate the control file dynamically and using the control file generated and data file load the data using sql loader.
For example :
Data file :
ABC,123,DEF,456,01/10/2021,GHI,100,09/30/2021

Record Inserted in table should be like :
image.pngPlease suggest how to generate the control file dynamically which will help in loading 'CONS' for 1st column & SYSDATE for 2nd column and rest of the columns should be loaded as per the data available in data file.

Thanks & Regards,
Biswajeet Ghosh

Comments
Post Details
Added on Oct 21 2021
3 comments
576 views