PowerDesigner can generate a SQL script from a PDM to create or modify a database. The statements that control script generation are available in the Script/Objects category.
When generating a SQL script, PowerDesigner takes each object to be created in turn, and applies the appropriate
Create or other statement to create or modify the object:
- Create - Creates a new object.
- Alter / Modify - Modifies the attributes of an existing object.
- Add - Creates a new sub-object. If keys are defined inside a table, they will be created with an Add statement, but if they are created outside the table, then they will be created with a table Modify statement.
- Rename - Renames an object.
- Drop - Drops an object (for use when an Alter statement is not possible).
- ObjectComment - Adds a comment on the object.
- Options - Defines the physical options of an object.
- ConstName - Defines the constraint name template for object checks.
For example, in Sybase ASE 15.7, the
Create statement in the Table category is the following:
create table [%QUALIFIER%]%TABLE%
(
%TABLDEFN%
)
[%OPTIONS%]
This statement contains the parameters for creating the table together with its owner and physical options using variables (see Variables for Tables and Views) that extract the necessary information from the object's properties. The %TABLDEFN% variable collects the Add items in the Column, PKey, Key, and Reference categories, and the AddTableCheck item in the Table category.
Other statements in the object categories are used to customize the PowerDesigner interface and behavior according to database features, such as Maxlen, Permission, EnableOwner, and AllowedADT.