WARNING - beginner
Hi,
I have a file structure as follows:-
.
./dat
./inf
./sql
./tmp
./tst
there is a text file in ./dat called customer_code.dat and another in tmp called customer_code_load.ctl
these directories lead from a directory called work where there is the following shell script:-
Code:
if [ $# != 1 ]
then
echo "usage customer_code.sh <data filename>"
exit
fi
FILE_NAME=`basename $1`
sqlload USERID=$USERNAME/$PASSWORD CONTROL=$SQL_IN/customer_code_load.ctl DATA=$1 ERRORS=0 SILENT=FEEDBACK DIRECT=TRUE
RESULT = $?
mv ./customer_code_load.log $SQL_IN
if [ $RESULT != 0 ]
then
echo "customer_details sqlload fails with $RESULT"
exit 1
fi
exit
the following errors are received:-
Code:
SQL*Loader-500: Unable to open file (/customer_code_load.ctl)
SVR4 Error: 2: No such file or directory
customer_code.sh[13]: RESULT: not found
mv: Insufficient arguments (1)
Usage: mv [-f] [-i] f1 f2
mv [-f] [-i] f1 ... fn d1
mv [-f] [-i] d1 d2
customer_code.sh[17]: test: argument expected
1) I haven't got the directions of the directories correct !
2) RESULT will be fixed when the first error is dealt with
3) the move command works from the command line !!
4) the test: error should also be sorted when the first one is fixed
the value in SQL_IN is the full path plus /work all other variables have valid values
tia,