db2 "connect to abcdb user www using www"
cat aaa.txt|while read A B
do
C=`db2 -x "select gongzi from gzb where bianhao=‘$B’" `
echo $A,$B,$C >> bbb.txt
done
2、222.sh
#!/bin/ksh
source /home/db2inst1/sqllib/db2profile
cat aaa.txt|while read A B
do
db2 "connect to abcdb user www using www"
C=`db2 -x "select gongzi from gzb where bianhao=‘$B’" `
echo $A,$B,$C >> bbb.txt
done