The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Tamino::Tran::Prepared - The Tamino driver's class implementing prepared statements.

SYNOPSIS

    use Tamino;
    
    my $tamino_client = Tamino->new(
        server      => '127.0.0.1/tamino'
        db          => 'mydb'
    );
    
    # $t will be a Tamino::Tran object
    my $t = $tamino_client->begin_tran
        or die $tamino_client->error;
    
    my $stmt = $t->prepare(q{for $x in input()/xxx[@yyy=$y][zzz=$z]}, {
        y => 'string',
        z => 'xs:integer'
    }) or die $t->error;
    
    my $xml = $stmt->execute({
        y => 'asdf',
        z => 123
    }) or die $t->error;
    
    my $cursor = $stmt->open_cursor({
        y => 'asdf',
        z => 123
    }, fetch_size => 10) or die $t->error;
    
    $stmt->destroy;

DESCRIPTION

This is just an API wrapper. This driver is based on LWP::UserAgent, XML::Twig, and inherits from Class::Accessor and Class::Data::Inheritable.

CONSTRUCTOR

Constructor is called internally by Tamino class object.

METHODS

execute

    $xml = $stmt->execute(\%vars_values);
    $xml = $stmt->execute({ y => 'string', z => 123 }) or die $t->error;

Execute prepared statement

open_cursor

    $cur = $stmt->open_cursor(\%vars_values, %cursor_options);
    $cur = $stmt->open_cursor({ y => 'string', z => 123 }, fetch_size => 10, scrollable => 1) or die $t->error;

Execute prepared statement and open a cursor for resultset. %cursor_options are the same as for "xquery_cursor" in Tamino::Tran.

destroy

    $stmt->destroy;