Subject Re: Firebird generators
Author Adam
--- In, "John Messingham"
<johnmessingham@...> wrote:
> Hi,
> I am trying to work out how to access and update Firebird
generators from a
> VB6 application, has anybody got any documentation about them or a
sample of
> code.
> Many Thanks
> John Messingham

The following query will increment and return a value that you can
use in a single atomic multi-transaction safe operation.

Select gen_id([your generator name], 1) as MyID

No idea about VB6, but you can do this the same way you would do any
other query. There is nothing special about the RDB$DATABASE table it
just exists in every database and has exactly 1 record. The gen_id
function accepts two parameters, the generator name and the amount
you want to increment by (usually 1).