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

NAME

DBIx::Connection::MySQL::PLSQL - PLSQL handler

SYNOPSIS

    use DBIx::PLSQLHandler;

    my $plsql_handler = new DBIx::PLSQLHandler(
        name        => 'test_proc',
        connection  => $connection,
        plsql       => "
        DECLARE
        var1 INT;
        BEGIN
        SET var1 := :var2 + :var3;
        END;",
        bind_variables => {
            var2 => {type => 'SQL_INTEGER'},
            var3 => {type => 'SQL_INTEGER'}
        }
    );
    $plsql_handler->execute(var2 => 12, var3 => 8);

    or

    use DBIx::Connection;
    ....

    my $plsql_handler = $connection->plsql_handler(
        name        => 'test_proc',
        connection  => $connection,
        plsql       => "
        DECLARE
        var1 INT;
        BEGIN
        :var1 := :var2 + :var3;
        END;",
        bind_variables => {
            var1 => {type => 'SQL_INTEGER'},
            var2 => {type => 'SQL_INTEGER'},
            var3 => {type => 'SQL_INTEGER'}
        }
    );

    my $result_set = $plsql_handler->execute(var2 => 12, var3 => 8);

METHODS

sql_defintion

Returns sql statment definitio, Takes sql name as parameter.

prepare

Prepares plsql block

initialise_plsql_block
drop_plsql_block

Removes plsql block wrapper

plsql_block_wrapper

Generates plsql procedure.

initialise_sql
execute

Executes plsql block

bind_parameters
parsed_plsql

Parses plsql code and replaces :var to var

type_map

mapping between DBI and database types. The following mapping is defined:

    SQL_DECIMAL => 'NUMERIC',
    SQL_VARCHAR => 'VARCHAR',
    SQL_DATE    =>'DATE',
    SQL_CHAR    =>'CHAR',
    SQL_DOUBLE  =>'NUMERIC',
    SQL_INTEGER =>'INT',
    SQL_BOOLEAN =>'BOOLEAN',
get_type

Returns

COPYRIGHT AND LICENSE

The DBIx::Connection::MySQL::PLSQL 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.

AUTHOR

Adrian Witas, adrian@webapp.strefa.pl

See also DBIx::Connection DBIx::QueryCursor DBIx::SQLHandler.