How to call SQL Loader in shell script?

HI Experts,

I am pretty new to scripting and i need to create a perl or shell script which should fetch a file from local directory and insert the data into a table using sql loader. This will be later added to chron job to run daily and fetch all files and load them into
the table.

Also i need the insert the file name as a value in a column while loading data. If any of you actually worked on this kind of task please help me.

This is what i need to do

file: FILE_NAME.txt

CODE         DATE
1234        01012015
1345        01012015
3456        01012015

after loading the date the table should look like this

CODE     DATE         FILE_NAME
1234     01012015     file_name.txt
1345     01012015     file_name.txt
3456     01012015     file_name.txt

we need to store this file name because there will be multiple files being placed in that location and
each file has different functionality. Please help me.

Bumping up posts or double posting is not permitted in these forums.

Please read the rules, which you agreed to when you registered, if you have not already done so.

You may receive an infraction for this. If so, don't worry, just try to follow the rules more carefully. The infraction will expire in the near future

Thank You.

The UNIX and Linux Forums.

1 Like