[CDBI] Sequences in Class::DBI?

Warren Toomey <wkt-G2kne9RB/[email protected]>
Newsgroups gmane.comp.lang.perl.modules.class-dbi
Message-ID <[email protected]>
Hi, I'm rewriting a reasonably big project to use Class::DBI instead of
DBIx::Abstract. How can one get access to sequences in Class::DBI? Given
a sequence in Postgresql, I want to access the current value and the next
value. With DBIx::Abstract I can do:

sub Get_NextSequence($)
{
  my ($result)= Clone()->select_one_to_array( "nextval('" . $_[0] ."')" );
  return($result || 0);
}

sub Get_CurrSequence($)
{
  my ($result)= Clone()->select_one_to_array( "currval('" . $_[0] ."')" );
  return($result || 0);
}

How can I do the same in Class::DBI? I assume that I will need a separate
class for each sequence, but given a sequence called 'daynum', how do I
write the class?

Many thanks,
	Warren
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.