Kbase P5190: How Do You Retrieve The Next Value Of A Sequence In SQL92?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  17/04/2006 |
|
Status: Verified
GOAL:
How do you retrieve the next value of a sequence in SQL92?
GOAL:
How to assign the next sequence value to a field in SQL92?
GOAL:
How to use sequence next value in SQL92?
FACT(s) (Environment):
Progress 9.1D
FIX:
The proper syntax for fetching the next value of a sequence is as follows:
SELECT PUB.<YourSequenceNameGoesHere>.NEXTVAL FROM PUB.<SomeTableName>
To assign the next sequence value use:
INSERT INTO PUB.Customer (CustNum, Name) values (pub.NextCustNum.nextval, 'Progress Software' )