1 package DBIx::Class::Storage::DBI::ODBC::DB2_400_SQL;
5 use base qw/DBIx::Class::Storage::DBI::ODBC/;
8 sub _dbh_last_insert_id {
9 my ($self, $dbh, $source, $col) = @_;
11 # get the schema/table separator:
12 # '.' when SQL naming is active
13 # '/' when system naming is active
14 my $sep = $dbh->get_info(41);
15 my $sth = $dbh->prepare_cached(
16 "SELECT IDENTITY_VAL_LOCAL() FROM SYSIBM${sep}SYSDUMMY1", {}, 3);
19 my @res = $sth->fetchrow_array();
21 return @res ? $res[0] : undef;
28 my ($self, $dbh) = @_;
31 limit_dialect => 'FetchFirst',
32 name_sep => $dbh->get_info(41)
41 DBIx::Class::Storage::DBI::ODBC::DB2_400_SQL - Support specific to DB2/400
46 # In your table classes
47 __PACKAGE__->load_components(qw/PK::Auto Core/);
48 __PACKAGE__->set_primary_key('id');
53 This class implements support specific to DB2/400 over ODBC, including
54 auto-increment primary keys, SQL::Abstract::Limit dialect, and name separator
55 for connections using either SQL naming or System naming.
60 Marc Mims C<< <marc@questright.com> >>
62 Based on DBIx::Class::Storage::DBI::DB2 by Jess Robinson.
66 You may distribute this code under the same terms as Perl itself.