X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI%2FODBC%2FDB2_400_SQL.pm;h=1bed7f58714550a9823b8082e46cda6c4464f7e1;hb=7f32c82b6791c30615bd6da46063e2a80be3ebc5;hp=e84c0879faaf5b8af4db54fdeae788b75941a1c9;hpb=a9f32dbced12b2b6c4f8b8a7aa142d5922350830;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Storage/DBI/ODBC/DB2_400_SQL.pm b/lib/DBIx/Class/Storage/DBI/ODBC/DB2_400_SQL.pm index e84c087..1bed7f5 100644 --- a/lib/DBIx/Class/Storage/DBI/ODBC/DB2_400_SQL.pm +++ b/lib/DBIx/Class/Storage/DBI/ODBC/DB2_400_SQL.pm @@ -3,33 +3,34 @@ use strict; use warnings; use base qw/DBIx::Class::Storage::DBI::ODBC/; +use mro 'c3'; -sub last_insert_id -{ - my ($self) = @_; - - $self->dbh_do(sub { - my $dbh = shift; +sub _dbh_last_insert_id { + my ($self, $dbh, $source, $col) = @_; - # get the schema/table separator: - # '.' when SQL naming is active - # '/' when system naming is active - my $sep = $dbh->get_info(41); - my $sth = $dbh->prepare_cached( - "SELECT IDENTITY_VAL_LOCAL() FROM SYSIBM${sep}SYSDUMMY1", {}, 3); - $sth->execute(); + # get the schema/table separator: + # '.' when SQL naming is active + # '/' when system naming is active + my $sep = $dbh->get_info(41); + my $sth = $dbh->prepare_cached( + "SELECT IDENTITY_VAL_LOCAL() FROM SYSIBM${sep}SYSDUMMY1", {}, 3); + $sth->execute(); - my @res = $sth->fetchrow_array(); + my @res = $sth->fetchrow_array(); - return @res ? $res[0] : undef; - }); + return @res ? $res[0] : undef; } sub _sql_maker_opts { my ($self) = @_; - + $self->dbh_do(sub { - { limit_dialect => 'FetchFirst', name_sep => shift->get_info(41) } + my ($self, $dbh) = @_; + + return { + limit_dialect => 'FetchFirst', + name_sep => $dbh->get_info(41) + }; }); } @@ -56,7 +57,7 @@ for connections using either SQL naming or System naming. =head1 AUTHORS -Marc Mims C<< >> +Marc Mims C<< >> Based on DBIx::Class::Storage::DBI::DB2 by Jess Robinson.