Call SQL LOADER FROM UNIX

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.

Please, try any of these:

$ awk '{printf "%-8s%-12s%s\n", $1, $2, FNR==1 ? "FILE_NAME" : FILENAME}' sam1234.file 
CODE    DATE        FILE_NAME
1234    01012015    sam1234.file
1345    01012015    sam1234.file
3456    01012015    sam1234.file
$ awk 'FNR==1{print $0, "FILE_NAME"; next}{print $0, FILENAME}' OFS='\t' sam1234.file
CODE         DATE       FILE_NAME
1234        01012015    sam1234.file
1345        01012015    sam1234.file
3456        01012015    sam1234.file
$ awk 'FNR==1{print $1, $2, "FILE_NAME"; next}{print $1, $2, FILENAME}' sam1234.file
CODE DATE FILE_NAME
1234 01012015 sam1234.file
1345 01012015 sam1234.file
3456 01012015 sam1234.file