| PAB3 documentation | view source | Contained in the PAB3 distribution. |
PAB3::DB::Max - Additional functions to PAB3::DB
use PAB3::DB::Max;
$data = $res->fetchall_arrayref();
$data = $res->fetchall_arrayref( {} );
$data = $stmt->fetchall_arrayref();
$data = $stmt->fetchall_arrayref( {} );
$data = $res->fetchall_hashref( $key );
$data = $stmt->fetchall_hashref( $key );
@row = $res->fetchrow_array();
@row = $stmt->fetchrow_array();
%row = $res->fetchrow_hash();
%row = $stmt->fetchrow_hash();
$row = $res->fetchrow_arrayref();
$row = $stmt->fetchrow_arrayref();
$row = $res->fetchrow_hashref();
$row = $stmt->fetchrow_hashref();
$data = $db->selectall_arrayref( $statement );
$data = $db->selectall_arrayref( $statement, @bind_values );
$data = $db->selectall_arrayref( $statement, {} );
$data = $db->selectall_arrayref( $statement, {}, @bind_values );
$data = $db->selectall_hashref( $statement, $key );
$data = $db->selectall_hashref( $statement, $key, @bind_values );
@row = $db->selectrow_array( $statement );
@row = $db->selectrow_array( $statement, @bind_values );
$row = $db->selectrow_arrayref( $statement );
$row = $db->selectrow_arrayref( $statement, @bind_values );
%row = $db->selectrow_hash( $statement );
%row = $db->selectrow_hash( $statement, @bind_values );
$row = $db->selectrow_hashref( $statement );
$row = $db->selectrow_hashref( $statement, @bind_values );
PAB3::DB::Max provides additional functions to PAB3::DB.
Once it has been loaded all functions becomes available to PAB3::DB.
use PAB3::DB::Max;
$db = PAB3::DB->connect( ... );
$row = $db->selectrow_hashref( 'select * from table' );
print $row->{'foo'}, "\n";
fetchrow_array() is a synonym for fetch_row()
fetchrow_hash() is a synonym for fetch_hash()
Fetches the next row of data and returns a reference to an array holding the field values or NULL if there are no more rows in result set. Null fields are returned as undef values in the array.
Fetches the next row of data and returns it as a reference to a hash containing field name and field value pairs or NULL if there are no more rows in result set. Null fields are returned as undef values in the hash.
Fetch all the data to be returned from a result or statement.
Parameters
{}
Fetch all fields of every row as a hash ref.
Return Values
It returns a reference to an array that contains one reference per row or NULL if there is no data.
Fetch all the data to be returned from a result or statement class as a reference to a hash containing a key for each distinct value of the $key column that was fetched.
Parameters
$key
Provides the name of the field that holds the value to be used for the key for the returned hash. For example:
$res = $db->query( 'select id, name from table' );
$data = $res->fetchall_hashref( 'id' );
# print name of id = 2
print $data->{2}->{'name'};
For queries returing more than one 'key' column, you can specify multiple column names by passing $key as a reference to an array containing one or more key column names. For example:
$res = $db->query( 'select id1, id2, name from table' );
$data = $res->fetchall_hashref( [ qw(id1 id2) ] );
# print name of id1 = 2 and id2 = 10
print $data->{2}->{10}->{'name'};
If @bind_values are not used, this method combines query() and fetchrow_array() into a single call.
If @bind_values are used, it combines prepare(), execute() and fetchrow_array().
If @bind_values are not used, this method combines query() and fetchrow_hash() into a single call.
If @bind_values are used, it combines prepare(), execute() and fetchrow_hash().
If @bind_values are not used, this method combines query() and fetchrow_arrayref() into a single call.
If @bind_values are used, it combines prepare(), execute() and fetchrow_arrayref().
If @bind_values are not used, this method combines query() and fetchrow_hashref() into a single call.
If @bind_values are used, it combines prepare(), execute() and fetchrow_hashref().
If @bind_values are not used, this method combines query() and fetchall_arrayref() into a single call.
If @bind_values are used, it combines prepare(), execute() and fetchall_arrayref().
If @bind_values are not used, this method combines query() and fetchall_hashref() into a single call.
If @bind_values are used, it combines prepare(), execute() and fetchall_hashref().
Interface for database communication PAB3::DB.
Christian Mueller <christian_at_hbr1.com>
The PAB3::DB module is free software. You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file.
| PAB3 documentation | view source | Contained in the PAB3 distribution. |