Sequences (PDM)

If your DBMS supports sequences, then you can create a sequence for a column.

A sequence is like an advanced form of an auto-incremented column. Where the latter is a column whose values automatically increment by 1, sequences allow you to define a more complex list of numbers. For example, you could define a list of numbers ranging between two values with an increment by any number (integer) you want.

Once you define a sequence, you can apply and enable it to a column. The data type for the column receiving the sequence must be a numeric data type. Such auto-incremented columns can be used in a key for a PDM table.

For more information on data types, see Selecting a data type for a column.

Example

Assume that you want to create a column listing the months of the year when quarterly reports are published: March, June, September, and December. The first report is published on the third month, the second on the sixth, the third on the ninth and the last on the twelfth.

You can define the proper sequence by typing the following values for sequence option parameters:

Parameter name

Description

Value

Start with

March is the third month of the year

3

Increment by

Look three months ahead to identify the next month in the list

3

Maxvalue

Stop when you have reached the last month of the year

12

The sequence created with these parameter settings allows you to automatically create the list of months in a year when quarterly reports are published.