Chapter 10 Generating a Database from a PDM


Inserting begin and end scripts for database creation

In a database creation script, you can insert the following scripts:

Script Where it is inserted
Begin script Before the command that creates the database
End script After the last command in the database creation script

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

Steps To insert begin and end scripts for database creation:

  1. Select Model→Model Properties.

    or

    Right click the diagram background.

    Select Properties from the contextual menu.

    The model property sheet appears.
  2. Click the Create tool next to the Database box.

    A confirmation box appears asking you to commit the creation of the database script object.
  3. Click Yes.

    The database property sheet appears.
  4. Type a name and code for the database.
  5. Click the Script tab.

    The Script page opens to the Begin page.
  6. Type the DBMS-specific commands to insert in the beginning of the script.
  7. Click the End tab at the bottom of the page.
  8. Type the DBMS-specific commands to insert at the end of the script.
  9. Click OK in each of the dialog boxes.

 


Copyright (C) 2005. Sybase Inc. All rights reserved.