1 package DBIx::Class::Storage::DBI::DB2;
6 use base qw/DBIx::Class::Storage::DBI/;
9 sub _dbh_last_insert_id {
10 my ($self, $dbh, $source, $col) = @_;
12 my $sth = $dbh->prepare_cached('VALUES(IDENTITY_VAL_LOCAL())', {}, 3);
15 my @res = $sth->fetchrow_array();
17 return @res ? $res[0] : undef;
20 sub datetime_parser_type { "DateTime::Format::DB2"; }
23 my ( $self, $opts ) = @_;
26 $self->{_sql_maker_opts} = { %$opts };
29 return { limit_dialect => 'RowNumberOver', %{$self->{_sql_maker_opts}||{}} };
36 DBIx::Class::Storage::DBI::DB2 - Automatic primary key class for DB2
40 # In your table classes
41 use base 'DBIx::Class::Core';
42 __PACKAGE__->set_primary_key('id');
46 This class implements autoincrements for DB2.
54 You may distribute this code under the same terms as Perl itself.