As a alternative way, you may forget about sequence name and create
rule for you table - simple rule that will make 'SELECT idColumnName'
on every INSERT action.
After trying several approaches I've chosen this way in my projects.
It's better way if you have some framework (R2O layer or smth).
On
On Sat, Jul 08, 2006 at 11:02:26PM -0700, Richard Broersma Jr wrote:
> > > > 3. If you call currval() will it return 20? I would think it does.
> >
> > Yes it does.
> >
> > > My understanding is that it will provided your are within a transaction.
> >
> > As long as you're in the same session
Richard Broersma Jr <[EMAIL PROTECTED]> writes:
> Just to clarify, currval() is isolated by the session on not
> necessarily by a transaction?
Yes, this is spelled out quite clearly in the docs if you care to read
them. :)
-Doug
---(end of broadcast)
> > > 3. If you call currval() will it return 20? I would think it does.
>
> Yes it does.
>
> > My understanding is that it will provided your are within a transaction.
>
> As long as you're in the same session you're fine. You would have to go out of
> your way to break it but if you're usin
Richard Broersma Jr <[EMAIL PROTECTED]> writes:
> > 3. If you call currval() will it return 20? I would think it does.
Yes it does.
> My understanding is that it will provided your are within a transaction.
As long as you're in the same session you're fine. You would have to go out of
your w
> I think I found the answer, you use the CURRVAL() function.
>
> Just to cover all the bases, consider this scenario in chronological order:
> 1. You insert data and the primary key is set to 20.
> 2. Someone else inserts data and the next key is set to 21.
> 3. If you call currval() will it r
I think I found the answer, you use the CURRVAL() function.
Just to cover all the bases, consider this scenario in chronological order:
1. You insert data and the primary key is set to 20.
2. Someone else inserts data and the next key is set to 21.
3. If you call currval() will it return 20?