Subject Re: [firebird-support] Getting a unique value from a generator
Author Hans
only GEN_ID(EXPORTLOCK_SEQ, 0) would give the same number one every time

usually folks use GEN_ID(EXPORTLOCK_SEQ, 1) to increment each time.

A mistaken GEN_ID(EXPORTLOCK_SEQ, -1) somewhere else in the
code would decrement each time.

An combination in the code of both 1 and -1, would cause the same number
too.


----- Original Message -----
From: "Peter Ypenburg" <PeterY@...>
To: <firebird-support@yahoogroups.com>
Sent: Thursday, May 12, 2005 1:09 PM
Subject: [firebird-support] Getting a unique value from a generator


> Hi There,
>
> Is it possible for two users who run the following SQL at the exact same
> time (each in their own transaction) to get the same value back from a
> generator. The SQL is as follows:
>
> SELECT GEN_ID(EXPORTLOCK_SEQ, -1)
> FROM RDB$DATABASE
>
> Thanks.
>
> Peter Ypenburg
> AGM: Product Development
> Barloworld Optimus
> Tel +2711 286 1587 Fax +2711 286 1630 Cell +2782 789 9167
> www.barloworldoptimus.com
>
> Disclaimer
>
> The information transmitted is the property of Barloworld Optimus Pty
> (Ltd)
> and is intended only for the person or entity to which it is addressed and
> may contain confidential and/or privileged material. Statements and
> opinions
> expressed in this e-mail may not represent those of the company. Any
> review,
> retransmission, dissemination and other use of, or taking of any action in
> reliance upon, this information by persons or entities other than the
> intended recipient is prohibited. If you received this in error, please
> contact the sender immediately and delete the material from any computer.
>
>
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://firebird.sourceforge.net and click the Resources item
> on the main (top) menu. Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Yahoo! Groups Links
>
>
>
>
>
>