Subject | Re: [firebird-support] Unbroken series of numbers |
---|---|
Author | Ann W. Harrison |
Post date | 2004-10-27T20:23:33Z |
At 03:55 PM 10/27/2004, =?ISO-8859-2?Q?Bogus=B3aw_Brandys?= wrote:
and whether you need to be absolutely certain that you never get a hole
in the sequence.
If the answer that holes are OK, then use a generator and reset
it monthly.
If the answer is a few, and holes are not OK, then setup a table
that contains only the next number. Reset the number monthly.
Increment the value by updating the record that holds it before
storing the document. If your transaction rolls back, the number
becomes available again.
If the answer is a lot and holes are not OK, then you've got a
problem and should look at the "auditable sequences" answers.
Regards,
Ann
>Hello,The answer depends somewhat on how many documents you expect to store
>
>I'd like to know how in Firebird is possible to have unbroken series of
>for example document's numbers but wrapped monthly for example.
>1\01\2004
>2\01\2004
>3\01\2004
>...
>1\02\2004
>2\02\2004
and whether you need to be absolutely certain that you never get a hole
in the sequence.
If the answer that holes are OK, then use a generator and reset
it monthly.
If the answer is a few, and holes are not OK, then setup a table
that contains only the next number. Reset the number monthly.
Increment the value by updating the record that holds it before
storing the document. If your transaction rolls back, the number
becomes available again.
If the answer is a lot and holes are not OK, then you've got a
problem and should look at the "auditable sequences" answers.
Regards,
Ann