Quote:
Originally Posted by blowtorch
Try piping the whole select statement to a 'while read ...'. I think that should work.
hi,
i tried piping the whole thing to while read but there are still some errors:
#construct SQL statement
{$DCITS_SQL << EOF
set head off
select a.FIN,a.STAFF_NAME_X,b.FIN,b.DEPT_C from ci_5day_staff a, ci_cits_consol_dtls b where a.FIN=b.FIN;
exit
EOF
}|while read line
do
if ["$line"]#check if line is not null
then
#if line not null, parse the line into words/variables
set $line #set the line to positional variables, in this case is $1 and $2
fin ="$1" #staff fin number
name="$2" #name of staff
gway="$3"
echo '$fin,$name,$gway' >> $final
endif
done
please help? thanks!