%GetNextSeqValue meta-SQL element
Syntax
%GetNextSeqValue(sequence_name)
Description
The %GetNextSeqValue meta-SQL function increments the given sequence and returns its next value.
Notes about %GetNextSeqValue
Note the following points about the %GetNextSeqValue function:
-
Use this function to generate order numbers, item numbers for lists, and so on.
-
With this function, you can create new sequences or migrate GetNextNumberWithGapsCommit() sequences.
Example
SQLExec("SELECT %GetNextSeqValue(PS_ORDER_NUMBER) FROM %SelectDummyTable", &order_number);