unixaixisql

0403-057 Syntax error at line 43 : `<' is not matched


I am receiving below error

0403-057 Syntax error at line 43 : `<' is not matched.

for below isql connection object on AIX server.

isql -Uusername -Sserver -Ppassword -w 5000  -s"|" << EOF >>$LOG

I have looked for various spacing options but all the same.

The value of $LOG is below.

LOG="./log.txt"

which is of course declared before the isql connection statement.

Please help. Thanks in advance.


Solution

  • I guess i figured out the answer here. I had to strip my script completely for that though

    while read line
    do
    
    echo "$line" | while IFS=\| read row_id col_name col_value
    do
    
    isql -Uusername -Sserver -Ppassword -w 5000  -s"|" << EOF >> $LOG
    
    EOF
    
    done < $FILE
    

    I removed all the sql statements from the above while loop to make it a bit less messy and easier to find out the culprit. Found out that I missed closing one of the while loops.

    Below is the correct loop.

    while read line
    do
    echo "$line" | while IFS=\| read tranche_id col_name col_value
    do
    
    isql -Uusername -Sserver -Ppassword -w 5000  -s"|" << EOF >> $LOG
    
    EOF
    
    done
    
    done < $FILE
    

    Sad how a 'done' missed my mind.