Previous Topic: Define a DB2 LUW SchemaNext Topic: Define DB2 LUW Stored Procedures


Define a DB2 LUW Sequence

Use the Sequence editor to define the parameters for a DB2 sequence.

To define a DB2 sequence

  1. Right-click a Sequence in the Model Explorer and select Properties.

    The DB2 Sequence Editor opens.

  2. Select a sequence and work with the following options:

    Note: Click New New icon in property editors to create a new object on the toolbar to create a sequence. Use the Enter filter text text box to filter a large list of names to locate the one you want to work with.

    Name

    Specifies the name of the sequence.

    Schema

    Specifies the default schema for the sequence. Select a schema from the drop-down list.

    Physical Data Type

    Specifies the physical data type for the sequence. Select a data type from the drop-down list.

    Use Replace Syntax

    Specifies that Forward Engineering will use the CREATE or REPLACE command instead of the CREATE command.

    Note: This field applies to DB2 for LUW version 9.7 only.

    Generate

    Specifies whether or not to generate DDL for this object during Forward Engineering.

  3. Work with the following fields on the General tab:
    Starting Value

    Specifies the first value for the sequence.

    Increment By

    Specifies the interval between consecutive values of the sequence.

    Specify Minimum Value/Minimum Value

    Specifies if you want to indicate the minimum value for the sequence. When you select True from the drop-down list, a second field appears, where you can indicate the value.

    Specify Maximum Value/Maximum Value

    Specifies if you want to indicate the maximum value for the sequence. When you select True from the drop-down list, a second field appears, where you can indicate the value.

    Cycle Values

    Specifies that the value of a sequence that reaches its maximum or minimum value to generate its respective minimum value or maximum value on the following NEXT VALUE expression. You can select Cycle or No Cycle.

    Cache Values

    Specifies the maximum number of sequence values that the database manager generates and stores in memory. When you select True from the drop-down list, the field Cache Capacity appears, where you can indicate the value.

    Order Values

    Specifies whether or not the sequence numbers must be generated in order of request.

  4. Work with the following fields on the Alias tab:
    Name

    Specifies the name of the sequence. The first name is always the sequence that you have currently selected. Click the New icon (icon) to create an alias.

    Schema

    Specifies the schema to associate with the alias sequence. Select a schema from the drop-down list.

    Note: The Alias tab for a Sequence applies to DB2 for LUW version 9.7 only.

  5. Click the Permission tab and grant permissions to users or roles on the selected sequence.
  6. Click the Comment tab and enter any comments you want associated with the sequence.
  7. Click the UDP tab to work with user-defined properties for the sequence.
  8. Click the Notes tab to view history information and view or edit user notes.
  9. Click Close.

    The DB2 for LUW Sequence Editor closes.

More information:

Add a Comment in a Property Editor

Add a UDP in a Physical Property Editor