Adrian Witas > DBIx-Connection-0.13 > DBIx::QueryCursor

Download:
DBIx-Connection-0.13.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.04   Source  

NAME ^

DBIx::QueryCursor - Database cursor handler

SYNOPSIS ^

    use DBIx::QueryCursor;
    my $cursor = new DBIx::QueryCursor(
        connection  => $connection,
        sql         => "SELECT * FROM emp WHERE ename = ?"
    );
    my $result_set = $cursor->execute(['Smith']);

    if($cursor->fetch()) {
        $ename = result_set->{ENAME};
        ... do some stuff
    }


    or

    use DBIx::Connection;

    my $cursor = $connection->query_cursor(
        sql         => "SELECT * FROM emp WHERE ename = ?"
    );

DESCRIPTION ^

Class that represents database cursor.

attributes

result_set

Fetch resultset.

rows

Number of rows retrieved since last execution.

methods

columns

Function return list of column from current cursor

execute

Executes statements, takes bind parameters as ARRAY ref, optionaly resul set as reference(HASH, SCALAR, ARRAY) Returns result set.

iterator

Returns the cursor itarator, on each iteration database error is checked. For instance sub query returned more then error exception is capture here.

fetch

Move cursor to next result. Returns true if a row was fetched or false if no more results exist.

finish

Signals that the cursor will not be used again.

columns_info

Returns column info for the cursor. my $cursor = $self->query_cursor( sql => $sql); $cursor->execute; $cursor->columns_info;

COPYRIGHT AND LICENSE ^

The DBIx::QueryCursor 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.

SEE ALSO ^

DBIx::Connection DBIx::SQLHandler.

AUTHOR ^

Adrian Witas, adrian@webapp.strefa.pl

syntax highlighting: