Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SQL Loader Control file WHEN clause to have SUBSTR function

Venkata Kiran Kumar KesariApr 30 2018 — edited May 1 2018

All,

I would like to restrict my data load using the SQL Loader Control file WHEN clause to look at the first 2 characters of a table column value. This is a character delimited file and needs to load only if the first 2 characters of a table column has specific value in it. If the first 2 characters are not as needed, we need to ignore those records.

I know that we will not be able to use the SUBSTR function in the SQL Loader control file WHEN clause. What would be the alternative to achieve this functionality.  I don't want to load everything and then delete the ones matching the criteria as its a huge file to load.

to achieve the functionality something like this...

Eg.

OPTIONS (SKIP=1)

LOAD DATA

APPEND

INTO TABLE MY_TABLE1

WHEN RECORD_TYPE_CODE ='05'

AND SUBSTR(APPRTN_ID,1,2) ='75'

Please suggest and provide me inputs.

Thanks & Regards,

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 29 2018
Added on Apr 30 2018
5 comments
7,149 views