MATSUNO★Tokuhiro > SQL-Maker-1.03 > SQL::Maker::SQLType

Download:
SQL-Maker-1.03.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Source   Latest Release: SQL-Maker-1.15

NAME ^

SQL::Maker::SQLType - SQL Types wrapper

SYNOPSIS ^

    use SQL::Maker::SQLType qw/sql_type/;
    use DBI qw/:sql_types/;
    use SQL::Maker::Select;
    
    my $cond = SQL::Maker::Select->new()
                                   ->add_select('id')
                                   ->add_from('foo')
                                   ->add_where(bar => sql_type(\"bar", SQL_VARCHAR));
    my @bind = @{$cond->bind()};
    my $sth = $dbh->prepare($cond->as_sql);
    for my $i (1..scalar(@bind)) {
        $sth->bind_param($i, ${$bind[$i-1]->value_ref}, $bind[$i-1]->type);
    }
    $sth->execute();
    print $sth->fetchrow_array(), "\n";

DESCRIPTION ^

This is a wrapper class for SQL types.

SEE ALSO ^

SQL::Maker::SQLType, http://labs.cybozu.co.jp/blog/kazuho/archives/2007/09/mysql_param_binding.php

syntax highlighting: