SQL::Maker::SQLType - SQL Types wrapper
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";
This is a wrapper class for SQL types.
SQL::Maker::SQLType, http://labs.cybozu.co.jp/blog/kazuho/archives/2007/09/mysql_param_binding.php
To install SQL::Maker, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SQL::Maker
CPAN shell
perl -MCPAN -e shell install SQL::Maker
For more information on module installation, please visit the detailed CPAN module installation guide.