Tamino::Tran::Prepared - The Tamino driver's class implementing prepared statements.
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;
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 is called internally by Tamino class object.
$xml = $stmt->execute(\%vars_values); $xml = $stmt->execute({ y => 'string', z => 123 }) or die $t->error;
Execute prepared statement
$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.
%cursor_options
$stmt->destroy;
To install Tamino, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Tamino
CPAN shell
perl -MCPAN -e shell install Tamino
For more information on module installation, please visit the detailed CPAN module installation guide.