in reply to [untitled node, ID 178308]

1stly I'd be using a bindvar for two reasons:
  1. Performance. You dont mention your db engine, however a decent RDBMS will hash your statement, then look the hash up in an internal table. If it finds a match it will used the previous statement. If not it will re-parse the statement. What you are doing by not using a bindvar (?) is making the statement change with each value, hence extra overhead for the engine to reparse essentially the same statement.
  2. Character parsing. If you use bindvars (also called placeholders) you dont have to worry about escaping characters such as single quotes! If you havent thought of this, consider the impact of:'value';drop comments; as the value of $news_id

To the orig. question, I personally prefer to use fetchrow_arrayref() then push a copy of it onto a return array. It works out kind a like a 2D array of columns in the "inside" array and rows on the "outside" array. It makes it nice and easy to process.

BTW, you have to make a copy of the container, as it is re-used for each row returned:

while (my $retval = $sth->fetchrow_arrayref()){ push @retary, [$retval]; }
should do it.. :-)

HTH!