1 package DBIx::Class::Storage::DBI::ODBC::DB2_400_SQL;
5 use base qw/DBIx::Class::Storage::DBI::ODBC/;
8 warn 'Major advances took place in the DBIC codebase since this driver'
9 .' (::Storage::DBI::ODBC::DB2_400_SQL) was written. However since the'
10 .' RDBMS in question is so rare it is not possible for us to test any'
11 .' of the "new hottness". If you are using DB2 on AS-400 please get'
12 .' in contact with the developer team:'
13 .' http://search.cpan.org/dist/DBIx-Class/lib/DBIx/Class.pm#GETTING_HELP/SUPPORT'
17 __PACKAGE__->sql_quote_char('"');
20 # Most likely all of this code is redundant and unnecessary. We should
21 # be able to simply use base qw/DBIx::Class::Storage::DBI::DB2/;
22 # Unfortunately nobody has an RDBMS engine to test with, so keeping
23 # things as-is for the time being
25 sub _dbh_last_insert_id {
26 my ($self, $dbh, $source, $col) = @_;
28 # get the schema/table separator:
29 # '.' when SQL naming is active
30 # '/' when system naming is active
31 my $sep = $dbh->get_info(41);
32 my $sth = $dbh->prepare_cached(
33 "SELECT IDENTITY_VAL_LOCAL() FROM SYSIBM${sep}SYSDUMMY1", {}, 3);
36 my @res = $sth->fetchrow_array();
38 return @res ? $res[0] : undef;
45 my ($self, $dbh) = @_;
48 limit_dialect => 'FetchFirst',
49 name_sep => $dbh->get_info(41)
58 DBIx::Class::Storage::DBI::ODBC::DB2_400_SQL - Support specific to DB2/400
63 # In your result (table) classes
64 use base 'DBIx::Class::Core';
65 __PACKAGE__->set_primary_key('id');
70 This class implements support specific to DB2/400 over ODBC, including
71 auto-increment primary keys, SQL::Abstract::Limit dialect, and name separator
72 for connections using either SQL naming or System naming.
77 Marc Mims C<< <marc@questright.com> >>
79 Based on DBIx::Class::Storage::DBI::DB2 by Jess Robinson.
83 You may distribute this code under the same terms as Perl itself.