package MyClass::DBI::SubClass; use base MyClass::DBI; __PACKAGE__->table('my_items'); __PACKAGE__->columns(All=>qw/id name qty parent/); sub next_val { my $self = shift; my $sth = $self->db_Main->prepare( qq(SELECT nextval(\'my_items_id_seq\') ) ); $sth->execute(); my $id = $sth->fetch(); return $id; }; sub curr_value { my $self = shift; my $sth = $self->db_Main->prepare( qq(SELECT currval(\'my_items_id_seq') )); $sth->execute(); my $id = $sth->fetch(); return $id; };