Progress Sequence

turif

New Member
Hi,

Is it possible to select the value of a sequence? (like you can select using Oracle?)
I know you can use the pub.'SEQUENCE_NAME'.NEXTVAL when inserting data into db, but I just would like to get the value of sequence.

Thank you,

Ferenc
 
If this were 4GL rather than SQL you would use NEXT-VALUE() and CURRENT-VALUE(). Soooooo... just guessing, I don't write much SQL, but you might want to give pub.'SEQUENCE_NAME'.CURRENTVAL or maybe pub.'SEQUENCE_NAME'.CURRVAL.
 
FWIW documentation says:
SELECT customer_sequence.CURRVAL FROM pub.customer;

Which seems kinda silly to me because a sequence has no implicit relation to a table in Progress. But anyhow this is how you can get it. (If you have 10.1B+ then use select top 1 so you only get 1 result back.)

Casper.
 
Back
Top