Limited support BMC provides limited support for this version of the product. As a result, BMC no longer accepts comments in this space. If you encounter problems with the product version or the space, contact BMC Support.BMC recommends upgrading to the latest version of the product. To see documentation for that version, see BMC AMI Catalog Manager for Db2 13.1.

Generating DDL to create objects


Catalog Manager provides several commands that generate data definition language (DDL) statements.

The DDL commands generate SQL to create the source objects themselves. In contrast, the CREATE command (see Using-an-existing-object-as-a-model-to-create-objects), generates SQL to create objects that are like source objects.

Related topic

To generate DDL to create objects

  1. Generate an object list.
  2. Specify the appropriate DDL command.
  3. Generate SQL.The following table describes the different DDL commands:

    Command

    Description

    Considerations

    Source objects

    From an object list: DDL

    From the Command line: DDL objectCode ownerName.objectName

    • Generates DDL to create the objects for which the command was entered
    • For multiple objects, generates individual DDL streams
    • The settings for the fields on the following options panels affect the DDL:
      • General Options: Decimal point and SQL string delimiter
      • SQL and Confirm Options: all fields
      • SQL Select: all fields
      • Switches: Define No
    • The BATCH keyword is valid for the DDL command. If you use the keyword in the command, you must issue the BATCH command to generate JCL. For more information, see Generating-JCL-for-a-job-in-batch

    AL
    CK
    CX
    DB
    DT
    FK
    FN
    IM
    IX
    MK
    MQT
    NP
    PK
    PM
    PR
    RO
    SE
    SG
    SY
    TB
    TC
    TR
    TS
    VW
    XT

    From an object list: HDDL

    From the Command line: HDDL objectCode ownerName.objectName

    • Generates DDL to create the objects for which the command was entered and for the dependent objects
    • For multiple objects, generates individual DDL streams for each object and its dependents
    • Enables you to include GRANT authorizations in the SQL
    • The HDDL command generates the DDL for implicitly created databases, table spaces, tables, and indexes as comments. For most objects, you should not uncomment the DDL. For additional indexes that you have created, the product might have commented out the DDL for the index with the following header in the output:

      --COMMENTED IMPLICIT

      If the indexes were created explicitly, uncomment the DDL.

    • To generate a single DDL stream for multiple objects and their dependents, issue the HDDL CONCAT command against the first object and mark additional objects with the equal (=) sign.
    • The BATCH keyword is valid for the HDDL command. If you use the keyword in the command, you must issue the BATCH command to generate JCL. For more information, see Generating-JCL-for-a-job-in-batch.
    • The settings for the fields on the following options panels affect the HDDL:
      • Object Use Options: Include in HDDL and Include in HDDL commit counts
      • SQL and Confirm Options: all fields
      • SQL Select: all fields
      • Switches: Define No, Cmp > 32k, HDDL Auths, and Build SQLID before GRANT

        If you specify N for the HDDL Auths switch and later decide to generate GRANT statements without CREATEs, use the HGRANT command. In this way, you can replicate objects on another Db2 subsystem and then grant identical or edited authorizations on the replicated objects. For more information about granting authorizations, see Managing-authorizations.

    • (BMC.DB2.SPE2307) To choose or verify which objects to include in the DDL generated online, issue the HDDL OPTS or HDDL OPT command against an object. Catalog Manager displays the Object Options panel before it processes the HDDL or HTDDL request and displays the Confirm SQL panel. For more information about the Object Options panel, see Setting-object-use-options.

    DB
    MQT
    SE
    TB
    TS
    VW

    From an object list: HTDDL

    From the Command line: HTDDL objectCode ownerName.objectName

    (SPE2005)

    • Generates DDL to create the tables for which the command was entered, dependent objects, and the parent database and table space
    • For multiple objects, generates individual DDL streams for each object and its dependents
    • Enables you to include GRANT authorizations in the SQL
    • The HTDDL command generates DDL for the parent database and table space for base tables (Type=T) only. The HTDDL command works in the same way as the HDDL command for all other table types.
    • The HTDDL command generates the DDL for implicitly created databases, table spaces, tables, and indexes as comments. For most objects, you should not uncomment the DDL. For additional indexes that you have created, the product might have commented out the DDL for the index with the following header in the output:

      --COMMENTED IMPLICIT
    • To generate a single DDL stream for multiple tables, issue the HTDDL CONCAT command against the first table and mark additional tables with the equal (=) sign.
    • The settings for the fields on the following options panels affect the HTDDL:
      • Object Use Options: Include in HDDL and Include in HDDL commit counts
      • SQL and Confirm Options: all fields
      • SQL Select: all fields
      • Switches: Define No, Cmp > 32k, HDDL Auths, and Build SQLID before GRANT

        If you specify N for the HDDL Auths switch and later decide to generate GRANT statements without CREATEs, use the HGRANT command. In this way, you can replicate objects on another Db2 subsystem and then grant identical or edited authorizations on the replicated objects. For more information about granting authorizations, see Managing-authorizations.

    • (BMC.DB2.SPE2307) To choose or verify which objects to include in the DDL generated online, issue the HTDDL OPTS or HTDDL OPT command against an object. Catalog Manager displays the Object Options panel before it processes the HDDL or HTDDL request and displays the Confirm SQL panel. For more information about the Object Options panel, see Setting-object-use-options.

    TB

    From an object list: MDDL

    From the Command line: MDDL objectCode ownerName.objectName

    • Generates DDL to create the objects for which the command was entered
    • Applies to only a single object type
    • For multiple objects of the same object type, generates one DDL stream for all of the objects
    • MDDL is a wait-for-enter command. For more information, see Issuing-Wait-for-Enter-commands-against-multiple-objects.
    • The settings for the fields on the following options panels affect the MDDL:
      • SQL and Confirm Options: all fields
      • SQL Select: all fields
    • The BATCH keyword is not valid for the MDDL command.

    AL
    CX
    DB
    DT
    FN
    IM
    IX
    MK
    MQT
    NP
    PM
    SE
    SG
    SY
    TB
    TR
    TS
    VW
    XT

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*