Progress
Language Reference


NEXT-VALUE Function

Interfaces
OS
SpeedScript
All
All
Yes

Returns the next integer value of a sequence, incremented by the positive or negative value defined in the Data Dictionary.

SYNTAX

NEXT-VALUE ( sequence [ , logical-dbname ] ) 

sequence

An identifier that specifies the name of a sequence defined in the Data Dictionary.

logical-dbname

An identifier that specifies the logical name of the database in which the sequence is defined. The database must be connected. If multiple databases are connected, you can omit this parameter if you specify a sequence that is unique to one of the databases.

EXAMPLE

The following trigger procedure uses the Next-Item-Num sequence to set the item-num field for a new item record.

r-critem.p
TRIGGER PROCEDURE FOR Create OF Item.

/* Automatically assign a unique item number using Next-Item-Num seq */

ASSIGN Item.Item-Num = NEXT-VALUE(Next-Item-Num). 

NOTES

SEE ALSO

CURRENT-VALUE Function, CURRENT-VALUE Statement


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095