in reply to Re: Creating Dynamic SQL statements using arrays
in thread Creating Dynamic SQL statements using arrays

The code I am using requires foreknowledge of the amount of results to be outtputted.
There's a bunch of ways you could do this, but they mostly depend on how you'll be outputting your data. If you're just listing what you got out of the database you could just do this
while(my $rr = $sth->fetchrow_hashref()) { print "$_: $rr->{$_}\n" for keys %$rr; }
Or if you're not too concerned about the field names you could just print out all the values like so
while(my @rows = $sth->fetchrow_array()) { print "Values: @rows\n"; }
Or if you want a list of enumerated the values
while(my @rows = $sth->fetchrow_array()) { print "$_: $rows\n" for @rows; }
So as you can see you have plenty of options. Personally I'd recommend using the fetchrow_hashref() method as the brain maps better to names than sequences. See the DBI docs for more info on the methods mentioned above.
HTH

_________
broquaint