Generating DDL Scripts

Generate DDL directly from the data model. PowerDesigner saves the results in a SQL script that you use to generate the tables and other objects in the target database.

Prerequisites 

Change the default database user.

Warning!  Use the model RAPCache.pdm to generate DDL for the RAPCache database. Do not use a different model by changing the target database to ASE, as this will result in the loss of index information.
  1. Select Database | Generate Database.
  2. Click browse, and select the directory where you want to store the script. Click OK.
  3. Enter a name for the SQL script. You will use this script in the next procedure.
  4. On the Options tabs, verify that the options are set correctly:

    Object

    Options

    Domain

    Create User-Defined Data Type

    Table


    • Create table

    • Physical options

    Column

    User data type

    Key


    • Create primary key

    • Inside

    • Physical options

    Index


    • Create index

    • Physical options

    • Index Filter Foreign Key

    • Index Filter Alternate Key

    • Index Filter Cluster

    • Index Filter Others

  5. Click the Selection tab.
  6. From the drop-down box on the right, choose the database owner.
  7. On the Tables tab, click Select All, which is to the right of the Database Owner box.
  8. Click OK. PowerDesigner checks the model for any errors, builds a result list, and generates the DDL. The Result dialog appears, identifying the name and location of the generated file. You can click Edit on the Result dialog 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 ignore these warnings.

  9. Close the Result dialog and the Result List dialog, then exit PowerDesigner.
    • If PowerDesigner prompts you to save the current workspace, click No.

    • If PowerDesigner prompts you to save the model, click Yes to save the modified model. Otherwise, click No.


Created March 26, 2009. Send feedback on this help topic to Sybase Technical Publications: pubs@sybase.com