On Tue, Oct 07, 2008 at 10:54:30AM +0200, Ludovic Legrand wrote:
> hi,
> I want to select the nextval of the sequence 'seq_id_comparison' of the
> table 'Comparison' with this line:
>
> $dbh->resultset('Comparison')->search(undef, {
> select => "nextval('seq_id_comparison')",
> as => 'id_comp',
> })->single->get_column('id_comp');
> SQL equivalent:
> SELECT NEXTVAL('seq_id_comparison');
>
> The SQL statement gives last_value + 1, that's ok, while the DBIx
> request gives something like last_value + 500 ...
> How to explain this increment ?
DBIC_TRACE=1 perl myscript.pl
and see what queries you're running.
Also please note it's DBIx::Class or DBIC, DBIx:: contains lots of other
projects.