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=8888a8ecdfec95dd5a53b2a91af8e04dbdacb983;hb=90d7422fc60a3bad71cc67dc20106ef68046664e;hp=c39a62243a1ff39054e70db6ad10d6aa9e0cf2ed;hpb=32a46300823ea3189061ca6e904b3899f9177cda;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 c39a622..8888a8e 100644 --- a/lib/DBIx/Class/Storage/DBI/ODBC/DB2_400_SQL.pm +++ b/lib/DBIx/Class/Storage/DBI/ODBC/DB2_400_SQL.pm @@ -1,36 +1,13 @@ package DBIx::Class::Storage::DBI::ODBC::DB2_400_SQL; + use strict; use warnings; -use base qw/DBIx::Class::Storage::DBI::ODBC/; - -sub last_insert_id -{ - my ($self) = @_; - - my $dbh = $self->_dbh; - - # 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(); - - return @res ? $res[0] : undef; -} - -sub _sql_maker_opts { - my ($self) = @_; - - return { - limit_dialect => 'FetchFirst', - name_sep => $self->_dbh->get_info(41) - }; -} +use base qw/ + DBIx::Class::Storage::DBI::DB2 + DBIx::Class::Storage::DBI::ODBC +/; +use mro 'c3'; 1; @@ -39,28 +16,17 @@ sub _sql_maker_opts { DBIx::Class::Storage::DBI::ODBC::DB2_400_SQL - Support specific to DB2/400 over ODBC -=head1 SYNOPSIS - - # In your table classes - __PACKAGE__->load_components(qw/PK::Auto Core/); - __PACKAGE__->set_primary_key('id'); - - =head1 DESCRIPTION -This class implements support specific to DB2/400 over ODBC, including -auto-increment primary keys, SQL::Abstract::Limit dialect, and name separator -for connections using either SQL naming or System naming. - - -=head1 AUTHORS +This is an empty subclass of L. -Marc Mims C<< >> +=head1 AUTHOR -Based on DBIx::Class::Storage::DBI::DB2 by Jess Robinson. +See L and L. =head1 LICENSE You may distribute this code under the same terms as Perl itself. =cut +# vim:sts=2 sw=2: