Usage for ddlgen

There are additional considerations when using ddlgen.

  • ddlgen does not identify existing sequences within views, stored procedures or triggers. For this reason, when generating DDL for a database, first run ddlgen on those views, stored procedures and triggers that are independent, before running ddlgen on those with dependencies. For example, if view B depends on view A, first run ddlgen on view A, before running it on view B.

  • The default information for ddlgen is:

    Option

    Parameter

    Required

    Default

    -U

    username

    Yes

    None

    -P

    password

    Yes

    None

    -S

    host_name:port_number

    Yes

    None

    -T

    object_type

    See the -T parameter description for a list of valid object types

    No

    Database

    -N

    object_name

    Yes, if object_type for -T is not DB (database)

    Default database name of username, if -Tobject_type is db or if -T is not specified

    -D

    database_name

    No

    Default database of username

    -X

    extended_object_type

    Options are:

    • OU – for user tables, user databases (excluding temporary databases), and stored procedures (excluding SQLJ procedures).

    • OD – for proxy tables, temporary databases, and SQLJ procedures.

    Use only when the object_type for -T is:
    • U (user table)

    • P (procedure)

    • DB (database)

    No

    None

    -O

    output_file_name

    No

    Standard out

    -E

    error_file_name

    No

    Standard out

    -L

    log_file_name

    No

    None

    -V

    version_number of ddlgen

    No

    None

  • At the command line, invoke ddlgen using the ddlgen shell script file (ddlgen.bat for Windows), included in your SAP ASE installation. The main class in DDLGen.jar is com.sybase.ddlgen.DDLGenerator.

  • To start ddlgen in the SQL Central plug-in for Adaptive Server:
    1. Right-click on the object for which you want to generate DDL.

    2. Select Generate DDL.

  • In the output DDL of create table, bind statements are generated as independent DLL instead of dependent DLL.

  • The PN type allows you to generate DDL for tables with partition names. Use partition names and the optdiag utility to analyze optimizer behavior by creating empty partitioned tables with simulated metadata.

    To generate names for local index partitions, use:
    ddlgen - TU -XPN
    To generate DDL for all user tables with partition names, use:
    ddlgen  -TU -XPN,OU
    ddlgen -TU -XOU,PN