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.

DB::MySQL v0.8

MySQL access for Perl6

Authors

  • Curt Tilmes
  • David Romero

License

BSD-2-Clause

Dependencies

DBNativeLibsNativeCallJSON::Fast

Test Dependencies

Provides

  • DB::MySQL
  • DB::MySQL::Connection
  • DB::MySQL::Converter
  • DB::MySQL::Native
  • DB::MySQL::Result
  • DB::MySQL::Statement

Documentation

The Camelia image is copyright 2009 by Larry Wall. "Raku" is a trademark of the Yet Another Society. All rights reserved.

Built with Podlite — the markup and publishing tools behind this site.