Create sequence with SQL in OpenEdge

Create sequence with SQL in OpenEdge

Sequences provides a bucket from which incremental numbers can be pulled. It is easy to create sequence in OpenEdge with both ABL and SQL. Documentation of sequence is covered quite well on https://documentation.progress.com/output/ua/OpenEdge_latest/index.html#page/dmsrf/create-sequence.html.

The easiest way to create a sequence is like so:

This will create a sequence with an initial value of 0. When we ask for next value from this sequence, we will receive 1. If called again, we will receive 2, and so on.

Retrieve the next number from this sequence, use nextval

Retrieve the current value of the sequence using currval. Note the 2 rs in currval.

Get information about the sequence from sysprogress like so:

Be sure to see other topics listed on Modern web applications and API with OpenEdge, SQL, ODBC and PHP.