Statement
NAME
DB::MySQL::Statement -- MySQL prepared statement object
SYNOPSIS
my $my = DB::MySQL.new;
my $db = $my.db;
my $sth = $db.prepare('select * from foo where x = ?');
my $result = $sth.execute(12);
DESCRIPTION
Holds a prepared database statement. The only thing you can
really do with a prepared statement is to execute it with
arguments to bind to the prepared placeholders.
METHODS
execute(**@args, Bool :$finish, Bool :$store = True)
Executes the database statement with the supplied arguments.
If the database returns results (e.g. for a 'SELECT'), this returns
a DB::MySQL::Result (actually a DB::MySQL::StatementResult)
object.
If :finish is True the database connection will finish
following the execution and retrieval of the results.
If the database does not return results (e.g. an 'INSERT'), it will return the number of rows affected by the query.
:store (defaults to True) causes the results to be retrieved
from server to client at once instead of retrieved row by row.
finish()
Calls finish on the creating database connection.
free()
Frees the resources associated with the prepared statement. You normally do not need to call this since cached statements want to stick around, and it will automatically be called when the garbage collector reaps the object anyway.