Skip to Main Content
  • Questions
  • SQL functions in control file when direct load

Breadcrumb

Question and Answer

Chris Saxon

Thanks for the question, Jose.

Asked: June 15, 2018 - 4:04 pm UTC

Last updated: June 18, 2018 - 10:31 am UTC

Version: 11g

Viewed 1000+ times

You Asked

Hello Tom,
I have 100 million records to load to a table. I am sqlldr to do so. I have been using the conventional load but is taking long. In the control file I have SQL functions to substring and other data manipulations. My question is, can I use direct load even if I have SQL functions in the control file?

and Chris said...

Let's check:

SQL> create table t (
  2    c1 varchar2(10)
  3  );

Table T created.

SQL>
SQL> ho type sqlldr.ctl
load data infile *
append into table t
fields terminated by ','
trailing nullcols
(c1 "upper(:c1)" )
begindata
col1
col2

SQL>
SQL> ho sqlldr userid=chris/chris@db control=sqlldr.ctl direct=y

SQL*Loader: Release 12.2.0.1.0 - Production on Mon Jun 18 11:30:04 2018

Copyright (c) 1982, 2017, Oracle and/or its affiliates.  All rights reserved.

Path used:      Direct

Load completed - logical record count 2.

Table T:
  2 Rows successfully loaded.

Check the log file:
  sqlldr.log
for more information about the load.

SQL>
SQL> select * from t;
C1
COL1
COL2


So that would be yes!

Is this answer out of date? If it is, please let us know via a Comment