Consultor Eletrônico



Kbase P93097: How to use the DYNAMIC-CURRENT-VALUE and the DYNAMIC-NEXT-VALUE functions?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   8/30/2004
Status: Unverified

GOAL:

How to use the DYNAMIC-CURRENT-VALUE and the DYNAMIC-NEXT-VALUE functions?

FACT(s) (Environment):

OpenEdge 10.x

FIX:

DYNAMIC-CURRENT-VALUE and the DYNAMIC-NEXT-VALUE functions return the current and next integer value respectively of a sequence defined in the specified database. The following sample code demonstrates the use of these two functions.


DEFINE VARIABLE cDatabaseName AS CHARACTER NO-UNDO.
DEFINE VARIABLE cSequenceName AS CHARACTER NO-UNDO.

CREATE ALIAS DICTDB FOR DATABASE VALUE(LDBNAME(1)).

cDatabaseName = LDBNAME(1).
FOR EACH DICTDB._Sequence:
ASSIGN
cSequenceName = _Sequence._Seq-name.
MESSAGE
"Database Logical Name: " "~t" LDBNAME(1) "~n"
"Database Sequence Name:" "~t" cSequenceName "~n"
"Sequence Current Value:" "~t" DYNAMIC-CURRENT-VALUE( cSequenceName, cDatabaseName) "~n"
"Sequence Next Value: " "~t" DYNAMIC-NEXT-VALUE( cSequenceName, cDatabaseName)
VIEW-AS ALERT-BOX INFO BUTTONS OK.
END.