A field may have data such as 'This is a test'.
If I select this field within a unix for loop the result of this query is
This
is
a
test.
How can I get it so that the result stays on one line.
The unix code is below.
number=`db2 -x "select distinct(number) from test"`
for n in $number
do
echo "getting data for number"
data=`db2 -x "select data from test where number= $number"`
for d in $data
do
echo $d
done
done
result is
1 This
1 is
1 a
1 test
ideal results
1 This is a test
If I select this field within a unix for loop the result of this query is
This
is
a
test.
How can I get it so that the result stays on one line.
The unix code is below.
number=`db2 -x "select distinct(number) from test"`
for n in $number
do
echo "getting data for number"
data=`db2 -x "select data from test where number= $number"`
for d in $data
do
echo $d
done
done
result is
1 This
1 is
1 a
1 test
ideal results
1 This is a test