Progress
Language Reference
CURRENT-VALUE Function
Returns the current integer value of a sequence defined in the Data Dictionary.
SYNTAX
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. You can omit this parameter if the sequence name is unambiguous. If a sequence with this name exists in more than one connected database, then you must specify logical-dbname.
EXAMPLEThe following example finds the current value of the next-cust-num sequence and then looks for orders with that customer number.
NOTES
- The current value of a sequence can be one of the following:
- Sequence values are stored in the database in which they are defined, and persist between each invocation of the CURRENT-VALUE statement or NEXT-VALUE function.
- You cannot invoke the CURRENT-VALUE function from within a WHERE clause. Doing so generates a compiler error. To use a result from the CURRENT-VALUE function in a WHERE clause, assign the result to a variable, then use the variable in the WHERE clause.
SEE ALSO
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |