fetchall_arrayref

fetchall_arrayref returns a reference to an array in which each item in the array is a reference to a row of data. This is very similar to the fetch function, except this one returns all of the data left in the $handle instead of just a single row.

Example:

my $ref = $handle->fetchall_arrayref; foreach my $row (@$ref) {     print "Row: ", join(‘, ‘, @$row), "\n"; } 

This example also prints out each row of data, just as we do previously with the fetch method. However, this method can use up considerably more memory than fetch, since it holds all of the returned data instead of just one row at a time.



Perl Database Programming
Perl Database Programming
ISBN: 0764549561
EAN: 2147483647
Year: 2001
Pages: 175

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net