Subject Re: [firebird-support] ID duplicated
Author Ann Harrison
On Wed, Mar 30, 2011 at 3:40 PM, ajose_s18 <ajose_s18@...> wrote:
> Hi,

> So I need to have a sequence by date of the field number, like, each day I start with the number 1, everything is fine, it works, but it started to duplicate some numbers in the field number. To get the next number I do for example "select max(number) from corte where date = 20110101", next I sum 1 to this number and then I do and insert into the table.

Yes, that's not going to work in a multi-user situation. That's why
sequences/generators were invented.
Read something about MVCC to understand why your solution doesn't
work. And do try a newer version
of Firebird.

Good luck,