Create a sequence

更新时间:
复制 MD 格式

In OceanBase Developer Center (ODC), click a connection name to open a connection in Oracle mode. In the navigation pane on the left, click the Sequences tag to view the list of sequences. To create a sequence, click + in the upper-right corner of the list, or click New > Sequence in the top navigation bar. Follow these steps to create the sequence:

  1. Set Basic information. Specify a Sequence Name. The Current User is automatically populated based on your connection account.

  2. Set columns (Optional): Specify the following information:

    Item

    Description

    Starts with

    Specifies the start value of the sequence. This value must be greater than or equal to the Minimum value.

    Incremental

    Specifies the step size for auto-incrementing the sequence value. This can be a negative number.

    Minimum

    Specifies the minimum value that the sequence can generate. The database supports a minimum value of -1026.

    Maximum

    Specifies the maximum value that the sequence can generate. The database supports a maximum value of 1027.

    Cache settings

    Specifies the size of the sequence cache. Setting a proper cache value improves performance when fetching sequence values. You can also select No cache.

    Order

    Specifies whether to generate sequence values in order. Fetching ordered values is slower than fetching unordered values.

    Loop

    Specifies whether the sequence restarts from the minimum value after it exceeds the specified Maximum value.

  3. Click Next: Confirm SQL to proceed to the SQL confirmation page.

    image.png

  4. Review the SQL script generated from your settings. If the script is correct, click Create in the upper-right corner of the page to execute the script and create the sequence.