Hi all

I know it is off topic but I just ran into this.
BTW sequences are not on the TODO.

When I use a sequence under Oracle I have to use nextval and currval on it.
nextval gives me a new (unused) number. With currval I can get the last new number for 
multiple querys.
To use a sequence you have to call <yourSequenceName>.nextval in each connection 
before any attempt to call
<yourSequenceName>.nextval.

Example:
SELECT my_sequence.nextval FROM dual
on a 'fresh' sequence my_sequence gives me 1.

SELECT my_sequence.nextval FROM dual
gives me 2.

SELECT my_sequence.currval FROM dual
gives me 2 again.

SELECT my_sequence.nextval, my_squence.nextval FROM dual
gives me 3, 3 (3 two times). This is because in one statement nextval is only called 
one time.

Till now it's OK for me.
But an 
SELECT my_sequence.currval, my_sequence.nextval FROM dual
gives me 4 for both sequence calls!
I had expected it would give me 3, 4.

I don't know if this is SQL standard conform.

Is there any experiance with other DB's?

TIA
Christian

-----------------------------------------------------------
Send a mail to [EMAIL PROTECTED] with
unsubscribe mysql [EMAIL PROTECTED]
in the body of the message to unsubscribe from this list.

Reply via email to