Upload data using sql loader

Make a batch file suppose load_data.bat

–content of the file is
–you keep the batch and controlfile in the same folder where the datafiles are there.
–This script will upload all data files within the same folder whatever fortmat they have

for %%f in (*.*) do (

echo %%f 
sqlldr user_name/passwrd Control = allfileloc.ctl data= %%f 
 
 )

—allfileloc.ctl file contents are below
—suppose column names are colm01..column10, change it according to your column names

load data
CHARACTERSET UTF8
append
into table scott.emp
fields terminated by "~" 
trailing nullcols
(
colm01,
colm02,
colm03,
colm04,
colm05,
colm06,
colm07,
colm08,
colm09,
colm10
)
Advertisements

About Sher khan

Senior Oracle DBA, Oracle 10g , Oracle 11g OCE ,Oracle 12C and Oracle 11g OPN certified Specialist, OCP Certified in Oracle 9i,10g , 11g and 12C. I am working in Oracle technology since 2004. Currently working in U.A.E Email: sher487@hotmail.com
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s