Previous Next

DYNAMIC-CURRENT-VALUE statement
Resets the current integer value of a sequence defined in the specified database.
Syntax 
 
DYNAMIC-CURRENT-VALUE( 
  sequence-exp , logical-dbname-exp [ , tenant-id ] ) = expression
sequence-exp
A character expression that evaluates to the name of a sequence.
logical-dbname-exp
A character expression that evaluates to the name of a connected database in which the sequence is defined.
tenant-id
An integer expression that evaluates to the tenant ID of a regular tenant, including the default tenant (0). This option applies only to a multi-tenant sequence specified by sequence-expression and is intended for access primarily by a super-tenant user.
If you are a regular-tenant user and you specify tenant-id, the specified tenant must be the same as the tenant associated with the database connection identity for logical-dbname-expression or the AVM raises a run-time error.
If you are a super-tenant user and you do not specify tenant-id, the function assumes the effective tenant ID (GET-EFFECTIVE-TENANT-ID function).
If the sequence specified by sequence-expression is non-multi-tenant (a shared sequence in a multi-tenant database), and you specify tenant-id, the option is ignored.
expression
An integer expression assigned as the current value of the specified sequence. If expression is outside the boundary set by the initial value (at one end) and the lower limit or upper limit (at the other end) for the sequence, the AVM returns an error, and the sequence value remains unchanged.
Notes 
*
If logical-dbname-exp contains the Unknown value (?), the AVM generates a run-time error.
*
*
If sequence-exp is a multi-tenant sequence in the database, each regular tenant has their own current value of the sequence. So, each tenant that invokes this statement can set their own current values, which can be the same or different than the current values set by other tenants. If the sequence is shared in a multi-tenant database, any current value set by this statement is shared by all tenants in the database.
Caution:
*
*
*
See also 
CURRENT-VALUE function, CURRENT-VALUE statement, DYNAMIC-CURRENT-VALUE function, DYNAMIC-NEXT-VALUE function, NEXT-VALUE function

Previous Next
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates.