You can insert custom scripts at the beginning and end of database, table, tablespace and other objects' creation statements directly from their property sheets. For example, access rights can be added under a table creation script. You can modify the standard creation statements for these and other objects by editing the DBMS definition file.
Open the property sheet of the object for which you want to specify a script, and click the Script tab. To open the script in your preferred editor (see Core Features Guide > Modeling with PowerDesigner > Customizing Your Modeling Environment > General Options > Text Editors), press Ctrl + E or click the Edit With tool.
Variable |
Description |
---|---|
%DATABASE%, %DBMSNAME% |
Name of the database and of the DBMS definition file. |
%NAMESCRIPT%, %PATHSCRIPT% |
Filename or path of script file |
%STARTCMD% |
Command that runs the script |
%AUTHOR%, %DATE% |
Author of the current model, and date of script generation. |
%TABLESPACE% |
Code of the tablespace. |
%TABLE% |
Name or code of table (based on display preferences). |
%TNAME%, %TCODE%, %TLABL% |
Name, code, or label of the table. |
%OWNER%, %OWNERPREFIX% |
Owner or owner prefix of the table or tablespace. |
%COLNLIST% |
List of the table's columns. |
%OPTIONS% |
Physical options defined on the object. |
This is my BeforeCreate script. /*==============================================================*/ /* Table: TABLE_1 */ /*==============================================================*/ This is my Header script. This is my Begin script create table TABLE_1 ( COLUMN_1 CHAR(10), COLUMN_2 CHAR(10), COLUMN_3 CHAR(10), constraint PK_TABLE_1 primary key () ); This is my End script This is my Footer script. This is my AfterCreate script.