Thread: SunOS

  1. #1
    Registered User
    Join Date
    Aug 2003
    Posts
    93

    SunOS

    is it okay to post SunOS 5.6 questions here, or not ?

  2. #2
    Registered User
    Join Date
    Aug 2003
    Posts
    93
    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,

  3. #3
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    >>the value in SQL_IN is the full path plus /work all other variables have valid values<<
    Prove it to yourself (and us ), by adding this:
    >>echo "ctl file is $SQL_IN/customer_code_load.ctl"
    at some point in the middle of your script.

    From the errors, this suggests $SQL_IN resolves to nothing:
    >>SQL*Loader-500: Unable to open file (/customer_code_load.ctl)
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  4. #4
    Registered User
    Join Date
    Aug 2003
    Posts
    93
    Hi Hammer,

    yes, unfortunately the variable seems to have lost its value, so I have now tagged this

    SQL_IN=/export/home/pac/work

    onto the end of the .profile


    can you recommend a good board for ksh shell scripting, I've been watching Sun's, but it is a little slow


    tia,

  5. #5
    Registered User
    Join Date
    Aug 2003
    Posts
    93

    Thumbs up

    ty Salem


Popular pages Recent additions subscribe to a feed