Inserting Begin and End Scripts for Database Creation

In a database creation script, you can insert a Begin script before the command that creates the database and an End script after the last command in the database creation script.

You can use the following variables in these scripts:

  1. Select Model > Model Properties or right-click the diagram background and select Properties.
  2. Click the Create tool to the right of the Database field and click Yes in the confirmation dialog to open the database property sheet.
  3. Enter a name and code for the database and then click the Script tab.
  4. Enter a Begin and/or End script as necessary on the appropriate subtab. You can use the following variables in these scripts:

    Variable

    Description

    %DATABASE%

    Name of the current PDM

    %DATE%

    Date of script generation

    %DBMSNAME%

    Name of the DBMS for the target database

    %NAMESCRIPT%

    Filename of script file

    %PATHSCRIPT%

    Filename and path of script file

    %STARTCMD%

    Command that runs the script

    %AUTHOR%

    Author of the current model

    For a complete list of the variables available and how to format them, see Customizing and Extending PowerDesigner > DBMS Definition Files > PDM Variables and Macros.

  5. Click OK to close the database property sheet and return to your model.