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 RAPStore.pdm to generate DDL for the RAPStore database. Do not use a different model by changing the target database to IQ, as this will result in the loss of index information.

  1. Select Database | Generate Database.
  2. Click browseand 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 tab, verify that the options are set correctly:

    Object

    Options

    Domain

    Create User-Defined Data tType

    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. 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. 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. You can click Edit to view the generated script. Close the Result dialog.

    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 List dialog, then exit PowerDesigner.

Note:

By default, the RAPStore.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 may want to add or remove indexes from the RAPStore data model. For detailed information on IQ indexes, see the Sybase IQ product documentation.


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