Storing values in variable

Hi All,

Here is the description of the problem.

I am scripting for database access using k-shell on solaris box
dbaccess <databasename> - << EOF 2>/dev/null | awk 'BEGIN {FS=" "}\
{printf "%s", $1}' | grep -v "^$" | \
read cnt1
OUTPUT TO PIPE cat WITHOUT HEADINGS
select count(*) from <tablename>;

/* In the above case the output is static that is we get only one value as the
output i amnt bothered abt the value and only the number of values obtained as output - here no of output is always = 1 */

select <col1>, <col2> from <tablename>
where <somecondition>;

/* In this case, based on the condition the output ---- > that is the no of values generated as output is varying and that in multiples of two ********
My question is how to store all the values in to variables.. preferably arrays as i have stored the output of the first query into variable cnt */

kindly help me with this issue.

You may try

set -A arr `dbaccess ...`