May 2005
Intermediate to advanced
352 pages
14h 39m
English
selectcol_arrayref( )
$database_handle->selectcol_arrayref($sql_statement[, \%attributes, @bind_values])
This returns a reference to
an array containing a value in the first column of each row selected.
The SQL statement is given as the first argument of the function.
This can be particularly useful if the first column is a key field.
This function performs prepare( ) and
execute( ) on the SQL statement.
...
my $sql_stmnt = "SELECT * FROM books";
my $book = $dbh->selectcol_arrayref($sql_stmnt);
foreach my $author_id (@$book){
print "$author_id \n";
}Read now
Unlock full access