Try OpenEdge Now
skip to main content
Programming Interfaces
Data Management : ABL API for Multi-tenant and Table Partition Management : Maintaining multi-tenant and table partition entities : Sequences (creating, reading, updating and deleting)
Sequences (creating, reading, updating and deleting)
The following code shows how to use the API service to create, read, update, and delete sequences using the ISequence interface:
define variable sequence as ISequence no-undo.

sequence = service:NewSequence("OrderSequence").
/* Set properties */
. . .

. . .
sequence = service:GetSequence("CustSequence").
/* Set properties */
. . .

. . .
It is also possible to retrieve a collection of sequences in the database from the service and then add, update, and remove sequences in the ISequenceSet collection before passing the collection to the service to commit all changes in a single transaction:
define variable sequenceSet as ISequenceSet no-undo.
define variable sequence as ISequence no-undo.
sequenceSet = service:GetUsers().
sequence = service:NewSequence("ItemSeq").
/* Set properties */
. . .
sequence = sequenceSet:Find("OrderSequence").
sequence:Description = "Sequence for the Order table.".
sequence = sequenceSet:Find("ItemSeq").
For more information on the:
*ISequence entity interface, see ISequence interface
*ISequenceSet entity collection interface, see ISequenceSet interface