Sequence Template Option

You can create a sequence by using an existing sequence as a template. This process is known as templating a sequence.
carcudb2
You can create a sequence by using an existing sequence as a template. This process is known as
templating
a sequence.
Follow these steps:
  1. Perform the following actions on the CA RC/Update Main Menu:
    • Type
      T
      in the Option field of the main header.
    • Type
      SQ
      in the Object field of the main header.
    • Type a name in the Item Name field to specify the sequence you want to template. If you do not specify a name, a selection panel appears when you press Enter.
    • (Optional) Type values for one or more of the remaining header fields. For more information on the fields, press F1 (Help).
    The Sequence Template panel appears.
  2. Complete header fields on the Sequence Template panel as follows and press Enter:
    • Sequence
      Specifies a name for your sequence.
    • Schema (first occurrence)
      Specifies the name of a sequence creator.
    • Schema (second occurrence)
      Specifies the high-level qualifier of the data type for the sequence. The value in this field, along with the value in the AS Type field, specifies the data type to be used for the sequence. When the value for AS Type is ambiguous or invalid, the value for this Schema field is also used as part of the criteria by which the column type selection list is built. This field is scrollable and expandable.
    • AS Type
      Specifies the sequence's data type, which can be any exact numeric data type (SMALLINT, BIGINT, INTEGER, or DECIMAL) or a user-defined distinct type for which the source type is an exact numeric data type with a scale of 0. This field is scrollable and expandable. Selection criteria are also accepted.
    • Comment
      Specifies whether comments are defined for the sequence. You can also enter comments.
    • N
      Indicates that no comments exist for the sequence. This is the default. If Y is displayed in this field, and you type over the Y with N, the existing comment is deleted.
    • Y
      Indicates that a comment is defined for the sequence.
    • U
      Indicates that you want to view, update, or delete the sequence's comment.
    • Precision
      Specifies the precision for the sequence. Precision depends on the data type of the sequence. You can enter a specific value for Precision only if the specified data type is one of the following:
      • A user-defined type (from which a defined precision can be picked up)
        When the sequence's data type is SMALLINT, INTEGER, or a distinct type that is sourced on SMALLINT, BIGINT, INTEGER or DECIMAL, you cannot edit the Precision field. Instead, the field displays a precision that is inherent to (or defined for) the specified type.
      • DECIMAL
If the data type is not user-defined or DECIMAL, Precision is set to 10 (for an INTEGER type) or 5 (for a SMALLINT type).
The values are applied as your templated sequence's attributes.
  1. Specify any changes to information for the Sequence Dynamics, and then press the END key.
    The RC/Update Creation Confirmation panel appears for confirming that you want to execute DDL to create your sequence.
  2. Perform
    one
    of the following actions:
    • Press Enter to execute the DDL online through the Batch Processor.
    • Enter
      E
      in the command line to edit the generated DDL.
    • Press the END key to return to the Sequence Template panel.
    Depending on the CA RC/Update Profile settings for your user ID, you might also have the option of rebuilding the DDL with RC/Alter so you can specify utilities and extended DDL generation and analysis options.
    Your session continues, depending on your choice.