Connecting Tech Pros Worldwide Help | Site Map

sqlloader shell script

Member
 
Join Date: Nov 2007
Posts: 75
#1: Jun 18 '08
Hi am calling sqlloader inlow shell script

#!/bin/sh
sqlldr scott/tiger control=ulcase1.ctl log=ulcase1.log
retcode=`echo $?`
case "$retcode" in
0) echo "SQL*Loader execution successful" ;;
1) echo "SQL*Loader execution exited with EX_FAIL, see logfile" ;;
2) echo "SQL*Loader exectuion exited with EX_WARN, see logfile" ;;
3) echo "SQL*Loader execution encountered a fatal error" ;;
*) echo "unknown return code";;
esac

#!/bin/ksh

while read table_name
do
echo "

I have set database name as scott/tiger .

I have following queries

1) what need to be done if i need to call that shell script in another database .
Means everytime its not posible to change the database name ..

is there any automatic process for it

thanks
gpraghuram's Avatar
Expert
 
Join Date: Mar 2007
Location: Chennai
Posts: 1,256
#2: Jun 19 '08

re: sqlloader shell script


If you want to change the database name on the fly then declare a variable and use it in the command.
The variable will be initialized either from command prompt or from a file

Hope i am clear

Raghu
Reply