Hi there,
I got a quite weird problem. Trying to update a table via a batch shell
script that looks like this
 
<snip>
while read AAA BBB
do
    mysql -u $DBUSER --password=$DBPASS --batch "--execute=update
XY_Table \
        set Column1 ='"$BBB"' where Column2 = '"$AAA"' LIMIT 1;" DBTABLE
>>$LOGFILE
    echo "AAA: "$AAA" BBB:"$BBB" End"
done <$INFILE
</snip>
 
With lines in $INFILE looking like this:
<snap>
1234 A - > 12 PCs
2345 B - > 13 < 100 PCs
....
</snap>
 
The weird thing is that the echo works properly and gives me results
like
AAA: 1234 BBB: A - > 12 PCs End
AAA: 2345 BBB: B - > 13 < 100 PCs End
...
 
But the mysql -u does not work and returns the sytax page to $LOGFILE
 
When I have a similar command using a fixed string (such as abcdef)
instead of $BBB (also omitting the "s around $BBB in the mysql command)
it works fine.
 
any ideas?
 

kind regards
Michael Baumann


Reply via email to