Generating DDL Scripts

Generate DDL scripts directly from the SAP Sybase IQ, SAP HANA, or ASE data model. PowerDesigner saves the results in a SQL script that you can use to generate the tables and other objects in the target database.

Use the model file of the database for which you wish to generate DDL scripts. For example, to generate DDL for the ASE database, use the ASE model. When you have the model open, do not change the target database as doing so results in the loss of index information.

By default, the ASE.pdm data model includes only those indexes that support the sample queries. The statements that create these indexes are included in the DDL scripts, which means the indexes supplied with the model are created automatically when you run the corresponding DDL scripts.

You can add or remove indexes from the ASE data model. For detailed information on ASE indexes, see the Adaptive Server Enterprise product documentation.

  1. Select Database > Generate Database.
  2. Browse to the directory where you want to store the script. Click OK.
  3. Enter a name for the SQL script.
  4. On the Options tab, verify that the options are set correctly:

    Object

    Options

    Domain

    Create User-Defined Data Type

    Table

    Create Table

    Column

    User Data Type

    Key

    Create Primary Key Inside

    Index

    • Create Index

    • Index Filter Foreign Key

    • Index Filter Alternate Key

    • Index Filter Cluster

    • Index Filter Others

  5. Click the Selection tab.
  6. Choose the database owner.
  7. On the Tables tab, click Select All.
  8. On the Domains tab, choose the database owner, click Select All, click Apply, then click OK.

    PowerDesigner checks the model for any errors, builds a result list, and generates the DDL. The Result dialog appears, which identifies the name and location of the generated file.

  9. You can click Edit to view the generated script.

    The Result List dialog appears in the background and may include several warnings, for example, "Existence of index" and "Existence of reference". You can safely ignore these warnings.

  10. Close the Result List dialog, then exit PowerDesigner.