Subject | Re: [firebird-support] Getting the current value of a sequence using new syntax |
---|---|
Author | Fidel Viegas |
Post date | 2008-02-15T07:40:28Z |
On Fri, Feb 15, 2008 at 2:10 AM, Helen Borrie <helebor@...> wrote:
shouldn't be an issue. It is a demo which is accessed by a single
user. I need to get the latest value so that I can display it in the
application after a successful insert. But, I was going to use that
because I wasn't aware of the insert.... returning... syntax. And I am
not using stored procedures. I surely wouldn't do that in a concurrent
environment, as I am aware it is not thread-safe.
Anyway, thanks for the input.
Fidel.
> No; but I'm curious to know why you need it - just because some peopleWell, I am not really using it in a concurrent environment, so that
> (unwisely) think they will massage the current (= latest-generated) value in
> some way, under the misapprehension that this practice is
> multi-transaction-safe. That's a no-no, unless you're writing the *only*
> application that will ever access your database *and* it's for stand-alone
> deployment *and* your application is written in such a way as to totally
> serialise everything.
shouldn't be an issue. It is a demo which is accessed by a single
user. I need to get the latest value so that I can display it in the
application after a successful insert. But, I was going to use that
because I wasn't aware of the insert.... returning... syntax. And I am
not using stored procedures. I surely wouldn't do that in a concurrent
environment, as I am aware it is not thread-safe.
> You can, however, "grab" the NEXT value into your application and work withI am using triggers.
> it safely, provided you don't have any INSERT or UPDATE triggers around that
> arbitrarily overwrite supplied NEW.primarykey or serial number values. Once
> a sequence number is generated it is never generated again (unless one
> foolishly messes around with its starting value, of course!)
Anyway, thanks for the input.
Fidel.