Hi,
i've written korn shell script. But when i try to do an update to Informix db in the same shell script, the value in the shell script is not getting passed onto the update command.Find my script below:
#!/usr/bin/ksh
INFORMIXDIR=xxxxxxx; export INFORMIXDIR
INFORMIXSERVER=xxxxxxx; export INFORMIXSERVER
ONCONFIG=xxxxxxxxxxx; export ONCONFIG
PATH=xxxxxxxxxx; export PATH
while read line
do
field1=`echo $line | cut -d',' -f1`
value=$field1
echo 'update table set typ1="ABC AB A/B" where type2="$value"' | dbaccess dbc
done < "$1"
here i am passing a .csv file as command line argument which contains values like A ABCD ABCD A1,ABC AB A/B
B BCAD BCAD B2,ABC AB A/B
i am cutting the first part of the line using comma(,) as delimiter and saving it in a variable. but when i pass that variable to update command, the table is not getting updated.
Could you please help me solve this.