Created
December 29, 2010 01:11
-
-
Save kazeburo/758000 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use DBI; | |
| use Carp; | |
| my $dbh = DBI->connect('dbi:MySQL:test','','', { | |
| RaiseError => 1, | |
| Callbacks => { | |
| ChildCallbacks => { | |
| execute___ => sub { | |
| my ($obj, @binds) = @_; | |
| warn @binds; | |
| map { ! defined $_ && Carp::croak('found undefined value') } @binds; | |
| return; | |
| }, | |
| }, | |
| }, | |
| }); | |
| $dbh->do(<<EOF); | |
| CREATE TABLE IF NOT EXISTS hoge ( | |
| foo VARCHAR(255) NOT NULL | |
| ) | |
| EOF | |
| my $foo; | |
| $dbh->do("SELECT FROM hoge WHERE foo=?",undef, $foo); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment