Subject | Re: Set generator values in Stored Procedure |
---|---|
Author | Svein Erling Tysvær |
Post date | 2004-09-30T09:54:10Z |
> > Is there any way of setting generator values (to 0) in a storedOr do
> > procedure?
>
> If you're using Firebird 1.5, use the EXECUTE STATEMENT statement.
GEN_ID(My_Generator, -GEN_ID(My_Generator, 0))
which should work in any version (or if GEN_ID doesn't accept
parametres, then get the value into a variable first). In case of
others interfering between the two calls (well, in most cases you
shouldn't decrement nor set a generator while people are using it),
the generator will not be reset to 0, but to a low positive number.
Set