1) Create a DB table
eg:
CREATE TABLE DATA_LOAD(NAME VARCHAR2(300),AGE NUMBER,DATE_OF_BIRTH DATE);
2) Create a control file to do the upload operation
eg: data_load.ctl
LOAD DATA
INTO TABLE "DATA_LOAD"
FIELDS TERMINATED BY '|'
TRAILING NULLCOLS
(
NAME,
AGE,
DATE_OF_BIRTH DATE "DD/MM/YYYY"
)
3) Create a data file
eg: data_load.dat
Tom|26|27-03-1983
Steps to Register Shell Script as a concurrent program:
Step #1
Place the
applications top directory.
For example, call the script XX_LOAD.prog and place it under
$CUSTOM_TOP/bin
Step #2
Make a symbolic link from your script to $FND_TOP/bin/fndcpesr
For example, if the script is called XX_LOAD.prog use this:
ln -s $FND_TOP/bin/fndcpesr XX_LOAD
This link should be named the same as your script without the
.prog extension.
Put the link for your script in the same directory where the
script is located.
Step #3
Register the concurrent program, using an execution method of
'Host'. Use the name of your script without the .prog extension
as the name of the executable.
For the example above:
Use XX_LOAD
Step #4
Your script will be passed at least 4 parameters, from $1 to $4.
$1 = orauser/pwd
$2 = userid(apps)
$3 = username
$4 = request_id
Any other parameters you define will be passed in as $5 and higher.
Make sure your script returns an exit status also.
Sample Shell Script to load data into oracle (XX_LOAD.prog)
-------------------------------------------------------------------------------------
#!/bin/sh
echo ' '
echo 'Parameters:'
echo '---------- '
echo ' File Path: '$5
echo ' Control File Name: '$6
echo ' Data File Name: '$7
echo ' '
sqlldr $1@$TWO_TASK control=$5/$6.ctl data=$5/$7.dat
log=$5/$6.log bad=$5/$6.bad discard=$5/$6.dsc
exit 0
-------------------------------------------------------------------------------------