Update a database table in a for loop

Im trying to update an informix database table for each occurance of a head_barcode in a file called mw within a for loop

please see below - cant get the syntax correct. any help please?

for a in `cat /tmp/mw`
do

sql image - << STOP > /dev/null 2>&1
update doc_table set status = 'Q'
where head_barcode = $a

STOP

 done

More details, please. What's not correct? Error messages? Undesired behaviour?

Hi Worky,

What errors do you see?
What's the OS
What version of Ingres?

Regards

Gull04

It appears to run with no error message but it does not update the database

Hi Worky,

Can you run it without the error message redirect, as in;

for a in `cat /tmp/mw`
do

sql image - << STOP
update doc_table set status = 'Q'
where head_barcode = $a

STOP

done

Can you send the output from, the questions in my previous post?

Regards

Gull04