PDM Variables and Macros

The SQL queries recorded in the DBMS definition file items make use of various PDM variables, which are written between percent signs. These variables are replaced with values from your model when the scripts are generated, and are evaluated to create PowerDesigner objects during reverse engineering.

For example, in the following query, the variable %TABLE% will be replaced by the code of the table being created:
CreateTable = create table %TABLE%
Note: You can use these variables freely in your own queries, but you cannot change the method of their evaluation (ie, %TABLE% can only ever evaluate to the code of the table). You can alternately, access any object properties using GTL (see Customizing Generation with GTL) and the public names available through the PowerDesigner metamodel (see The PowerDesigner Public Metamodel).

The evaluation of variables depends on the parameters and context. For example, the %COLUMN% variable cannot be used in a Create Tablespace query, because it is only valid in a column context.

These variables can be used for all objects supporting these concepts:

Variable

Comment

%COMMENT%

Comment of Object or its name (if no comment defined)

%OWNER%

Generated code of User owning Object or its parent. You should not use this variable for queries on objects listed in live database reverse dialog boxes, because their owner is not defined yet

%DBPREFIX%

Database prefix of objects (name of Database + '.' if database defined)

%QUALIFIER%

Whole object qualifier (database prefix + owner prefix)

%OPTIONS%

SQL text defining physical options for Object

%OPTIONSEX%

The parsed SQL text defining physical options of the object

%CONSTNAME%

Constraint name of Object

%CONSTRAINT%

Constraint SQL body of Object. Ex: (A <= 0) AND (A >= 10)

%CONSTDEFN%

Column constraint definition. Ex: constraint C1 checks (A>=0) AND (A<=10)

%RULES%

Concatenation of Server expression of business rules associated with Object

%NAMEISCODE%

True if the object (table, column, index) name and code are identical (AS 400 specific)

%TABLQUALIFIER%

Parent table qualifier (database prefix + owner prefix)

%TABLOWNER%

The generated code of the user owning the parent table