Online Documentation for SQL Manager for DB2

Creating/editing sequence


Use the Sequence tab of Sequence Editor to create/edit a sequence and specify its definition.

 

Sequence Editor - Editing sequence definition

 

 

Sequence schema

Use the drop-down list to select the schema for the new sequence.

 

Sequence name

Enter a name for the new sequence.

 

Start with

Specifies the first value for the sequence. The DEFAULT value is 1.

 

CheckBox Cycle

Specifies that the Start with sequence values are generated cyclically.

 

Increment

Specifies the interval between consecutive values of the sequence. The DEFAULT value is 1.

 

CheckBox Order

Specifies that the sequence numbers are generated in order of request.

 

Min value

Type in the numeric constant that is the minimum value or select DEFAULT from the drop-down list. The DEFAULT value for an ascending sequence is the Start with value, or 1 if Start with is not specified. For a descending sequence, the DEFAULT value is the minimum value of the data type associated with the sequence.

 

Max value

Type in the numeric constant that is the maximum value or select DEFAULT from the drop-down list. The DEFAULT value for an ascending sequence is the maximum value of the data type associated with the sequence. For a descending sequence, the value is the START WITH value, or -1 if START WITH is not specified.

 

Cache

Specify the maximum number of sequence values that are preallocated and kept in memory or select NO CACHE from the drop-down list. The DEFAULT value is 20.

 

Data type

Use the drop-down list to select the data type to be used for the sequence value.

 

Restart options

This group of options is available on editing an existing sequence.

 

Sequence Editor - Editing sequence definition - Restart options

 

 

CheckBox Restart sequence

Check this option to modify the next value that will be returned by the sequence object. If the CheckBox Restart with option is unchecked then the sequence is restarted at the value specified as the Start value of the edited sequence. Otherwise, the sequence will be restarted the value specified in the corresponding field. specified value. This value can be any positive or negative value that could be assigned to a column of the data type associated with the sequence, without non-zero digits existing to the right of the decimal point.