1 package DBIx::Class::PK::Auto::DB2;
6 use base qw/DBIx::Class/;
8 __PACKAGE__->load_components(qw/PK::Auto/);
14 my $dbh = $self->result_source->storage->dbh;
15 my $sth = $dbh->prepare_cached("VALUES(IDENTITY_VAL_LOCAL())");
18 my @res = $sth->fetchrow_array();
20 return @res ? $res[0] : undef;
28 DBIx::Class::PK::Auto::DB2 - Automatic primary key class for DB2
32 # In your table classes
33 __PACKAGE__->load_components(qw/PK::Auto::DB2 Core/);
34 __PACKAGE__->set_primary_key('id');
38 This class implements autoincrements for DB2.
46 You may distribute this code under the same terms as Perl itself.