意外的令牌&#34; =&#34;发现在&#34; <identifier>&#34;之后。预期的代币可能包括:&#34; WITH&#34;。 SQLSTATE = 42601 </标识符>

时间:2014-11-13 21:42:29

标签: sql database bash db2

while [ 1 ]
do
echo "Select number from the following options"
echo "1 - Data Base Menu
2 - Customer Sale

3 - Quit"

read opt
case $opt in
    "1")
        managementMenu
            ;;
    "2") echo " Enter Sale Code"
          read eCode 
        echo " Enter client Code: "
                read cCode
        echo " Enter product "
                read product
        echo " Enter Quantity "
                read QTY
    db2 "update Sales set QTY = $QTY where SNR = '$eCode' and PNR = '$product'"
    **db2 "update Histroy set QTY = $QTY where CCN = '$cCode' and PNR = '$product'"**
            ;;

    "3")
        break
            ;;
    *) echo invalid option;;
esac
done
# cant use select * to display

1 个答案:

答案 0 :(得分:2)

而不是执行

db2 "update Sales set ...

尝试使用

db2 -v "update Sales set ...

这将导致DB2 CLP回显它正在获取的实际SQL语句,这可能会显示导致错误的原因。 (即@ p.s.w.g建议)