PowerDesigner can use variables in the generation and reverse-engineering of columns, domains, and constraints. Parent table variables are also available.
The following variables are available for columns:
Variable |
Comment |
---|---|
%COLUMN% |
Generated code of Column |
%COLNNO% |
Position of Column in List of columns of Table |
%COLNNAME% |
Name of Column |
%COLNCODE% |
Code of Column |
%PRIMARY% |
Contains Keyword "primary" if Column is primary key column |
%ISPKEY% |
TRUE if Column is part of a primary key |
%ISAKEY% |
TRUE if Column is part of an alternate key |
%FOREIGN% |
TRUE if Column is part of a foreign key |
%COMPUTE% |
Compute constraint text |
%PREVCOLN% |
Code of the previous column in the list of columns of the table |
%NEXTCOLN% |
Code of the next column in the list of columns of the table |
%NULLNOTNULL% |
Mandatory status of a column. This variable is always used with NullRequired item, see Working with Null Values |
%PKEYCLUSTER% |
CLUSTER keyword for the primary key when it is defined on the same line |
%AKEYCLUSTER% |
CLUSTER keyword for the alternate key when it is defined on the same line |
%AVERAGELENGTH% |
Average length |
%ISVARDTTP% |
TRUE if the column datatype has a variable length |
%ISLONGDTTP% |
TRUE if the column datatype is a long datatype but not an image or a blob |
%ISBLOBDTTP% |
TRUE if the column datatype is an image or a blob |
%ISSTRDTTP% |
TRUE if the column datatype contains characters |
The following variables are available for domains:
The following variables are available for constraints:
Variable |
Comment |
---|---|
%UNIT% |
Unit attribute of standard check |
%FORMAT% |
Format attribute of standard check |
%DATATYPE% |
Data type. Ex: int, char(10) or numeric(8, 2) |
%DTTPCODE% |
Data type code. Ex: int, char or numeric |
%LENGTH% |
Data type length. Ex: 0, 10 or 8 |
%PREC% |
Data type precision. Ex: 0, 0 or 2 |
%ISRDONLY% |
TRUE if Read-only attribute of standard check has been selected |
%DEFAULT% |
Default value |
%MINVAL% |
Minimum value |
%MAXVAL% |
Maximum value |
%VALUES% |
List of values. Ex: (0, 1, 2, 3, 4, 5) |
%LISTVAL% |
SQL constraint associated with List of values. Ex: C1 in (0, 1, 2, 3, 4, 5) |
%MINMAX% |
SQL constraint associated with Min and max values. Ex: (C1 <= 0) AND (C1 >= 5) |
%ISMAND% |
TRUE if Domain or column is mandatory |
%MAND% |
Contains Keywords "null" or "not null" depending on Mandatory attribute |
%NULL% |
Contains Keyword "null" if Domain or column is not mandatory |
%NOTNULL% |
Contains Keyword "not null" if Domain or column is mandatory |
%IDENTITY% |
Keyword "identity" if Domain or Column is identity (Sybase specific) |
%WITHDEFAULT% |
Keyword "with default" if Domain or Column is with default |
%ISUPPERVAL% |
TRUE if the upper-case attribute of standard check has been selected |
%ISLOWERVAL% |
TRUE if the lower-case attribute of standard check has been selected |
%UPPER% |
SQL constraint associated with upper only values |
%LOWER% |
SQL constraint associated with lower only values |
%CASE% |
SQL constraint associated with cases (upper, lower, first word capital, etc) |