for loop with db2 command

Having some trouble with usage of for loop and displaying words. Basically I had 3 words( some times more )
in the variable. I want to get one at a time to process.

I am new to unix scripting so please bear with my question and appreciate your reply. I think this can also me done my awk command but I don't know how.. So appreciate your help.

Shell script is

 table\_name='TAB_NAME'
 schema\_name='SCH_NAME'
 db2 "connect to DB2D"

 tempfile1=\`db2 -x "select concat\(pkgschema,concat\('.',pkgname\)\) from 
                syscat.packagedep where bname='"$table_name"' and 
                bschema='"$schema_name"' with ur "\` 
 echo ' ---tempfile  after the db2 command ------- '  $tempfile1
for variable in $tempfile1; do 
 echo $tempfile1[0]
done

db2 "connect reset"

After the db2 command tempfile1 looks like ( 3 words seperated by blank)
sch1.package1 sch2.package2 sch3.package3

In the for loop also it shows like
sch1.package1 sch2.package2 sch3.package3 [0]
sch1.package1 sch2.package2 sch3.package3 [0]
sch1.package1 sch2.package2 sch3.package3 [0]

Expected output is

sch1.package1
sch2.package2
sch3.package3

I did it ..

Here is the code
-----------------------------------------------------------------
#!/bin/ksh
#========================================================
count_args() # Returns count of input ARG_LIST
#========================================================
# Arg_n = ARG_LIST
{
echo $#
}

table_name='TAB_NAME'
schema_name='SCH_NAME'
db2 "connect to DB2D"

tempfile1=`db2 -x "select concat(pkgschema,concat('.',pkgname)) from syscat.packagedep where bname='"$table_name"' and bschema='"$schema_name"' with ur "`
words=`count_args $tempfile1`
echo "$tempfile1 = $words words" > temp.out

tfile_length=`wc -l temp.out | cut -c1-8` tfile_len=`expr $tfile_length + 0`

while [ "$tfile_len" -ne 0 ]
do
tline=`tail -$tfile_len temp.out | head -1 | cut -c1-30`
echo $tline ";"
tfile_len=`expr $tfile_len - 1`
done