1 package DBIx::Class::Storage::DBI::DB2;
6 use base qw/DBIx::Class::Storage::DBI/;
8 # __PACKAGE__->load_components(qw/PK::Auto/);
14 my $dbh = $self->_dbh;
15 my $sth = $dbh->prepare_cached("VALUES(IDENTITY_VAL_LOCAL())", {}, 3);
18 my @res = $sth->fetchrow_array();
20 return @res ? $res[0] : undef;
24 sub datetime_parser_type { "DateTime::Format::DB2"; }
30 DBIx::Class::Storage::DBI::DB2 - Automatic primary key class for DB2
34 # In your table classes
35 __PACKAGE__->load_components(qw/PK::Auto Core/);
36 __PACKAGE__->set_primary_key('id');
40 This class implements autoincrements for DB2.
48 You may distribute this code under the same terms as Perl itself.