Sei sulla pagina 1di 70

ADVANCED TECHNICAL

DOCUMENTATION

Definition File Reference Guide


POWERDESIGNER 6.1

December 1997
Copyright 1991-1997 Sybase, Inc. and its subsidiaries.
All rights reserved.
Printed in the United States of America.
Information in this manual may change without notice and does not represent a commitment on the part of
Sybase, Inc. and its subsidiaries.
The software described in this manual is provided by Powersoft Corporation under a Powersoft License
agreement. The software may be used only in accordance with the terms of the agreement.
No part of this publication may be reproduced, transmitted, or translated in any form or by any means,
electronic, mechanical, manual, optical, or otherwise, without the prior written permission of Sybase, Inc. and
its subsidiaries.
Sybase, Inc. or its subsidiaries claim copyright in this program and documentation as an unpublished work,
revisions of which were first licensed on the date indicated in the foregoing notice. Claim of copyright does
not imply waiver of other rights of Sybase, Inc. and its subsidiaries.
ClearConnect, Column Design, ComponentPack, InfoMaker, ObjectCycle, PowerBuilder, PowerDesigner,
Powersoft, S-Designor, SQL SMART, and Sybase are registered trademarks of Sybase, Inc. and its
subsidiaries. Adaptive Component Architecture, Adaptive Server Anywhere, Adaptive Server Enterprise,
Adaptive Warehouse, AppModeler, DataArchitect, DataExpress, Data Pipeline, DataWindow, dbQueue,
ImpactNow, InstaHelp, Jaguar CTS, jConnect for JDBC, MetaWorks, NetImpact, PowerDynamo, Optima++,
Power++, PowerAMC, PowerBuilder Foundation Class Library, Power J, PowerScript, PowerSite, Powersoft
Portfolio, Powersoft Professional, PowerTips, ProcessAnalyst, Runtime Kit for Unicode, SQL Anywhere, The
Model For Client/Server Solutions, The Future Is Wide Open, Translation Toolkit, UNIBOM, Unilib, Uninull,
Unisep, Unistring, Viewer, WarehouseArchitect, Watcom, Watcom SQL Server, Web.PB, and Web.SQL are
trademarks of Sybase, Inc. or its subsidiaries. Certified PowerBuilder Developer and CPD are service marks
of Sybase, Inc. or its subsidiaries. DataWindow is a patented proprietary technology of Sybase, Inc. or its
subsidiaries.
AccuFonts is a trademark of AccuWare Business Solutions Ltd.
All other trademarks are property of their respective owners.

Definition File Reference Guide

About this document

This document will help you to use and modify definition (DEF) files. The DEF files define target
databases that interface with PowerDesigner.

Contents

Topic

Page

Overview

General Formatting

PowerDesigner Variables

General Macros

10

Field Details

12

Before you begin

Make backup copies of the original DEF files before you make any changes to the DEF files.
Changes to the DEF files will impact how PowerDesigner functions, especially in regard to
generated scripts. Make sure that you thoroughly test generated scripts and backup your database
prior to excuting these scripts.

Overview
This documentation presents a preliminary description of PowerDesigner DEF files.
PowerDesigner uses DEF files to define database-specific capabilities and SQL syntax. The DEF
file is a required component of PowerDesigner when working with Physical Data Models (PDM) or
WarehouseArchitect Models (WAM). Through the use of the DEF file, PowerDesigner ensures that
differences between databases are handled properly. Because each database is different, each
database has its own DEF file.
Each DEF file is made up of a number of sections:

Database and target database identification


Database characteristics
Database command definition
Data type translation tables

Each section of the DEF file is composed of a series of fields and field values. These fields are
parameters recognizable by PowerDesigner. All of the DEF files have the same structure,
regardless of the target database.
The values for DEF file fields is what varies for each target database. Some fields may not be
found in a DEF file if that function does not apply to the specific target database.
Scope of DEF file control

Although every effort has been made to allow total control of the database generation process
via the DEF files, some database-specific functionalities were impractical to implement via this
structure. These functionalities are hardcoded in the PowerDesigner application and cannot be
controlled via the DEF file.
PowerDesigner reads the DEF file sequentially, from left to right and from top to bottom
The following sections describe general formatting issues that apply to many of the DEF file fields
and then describe each field and the allowable values for all the DEF files.
Some DEF file parameters or variables are not described in this document. The explanations of
specific database parameters and variables, data warehouse parameters and variables, new
generation parameters and variables added for the latest versions of the databases, message
parameters, and trigger parameters and variables are not included here.

$ For information on trigger parameters and variables, see the chapter on triggers and
procedures in the User's Guide for the PowerDesigner module (DataArchitect, AppModeler, or
WarehouseArchitect) that you are using..

General formatting
File format
The DEF file is a text file and can be viewed or modified using any editor that can handle text files.
When saving the file, make sure that you save it as a text file.

Entry syntax
Each DEF file entry has the following syntax:
# comment describing the field
fieldname = field value

# in the first column designates a comment line and terminates the previous entry.
fieldname relates to the keywords recognized by PowerDesigner when reading DEF files. The
fieldname is also called a parameter in this documentation.
field value is the database specific value for this field. Field values may be one of three types:

Yes/No values for setting flags and options


SQL syntax required to execute a specific function. PowerDesigner variables and macros are
allowed in these values. Each new parameter begins with a PowerDesigner keyword and ends
with a # that begins the next comment
Lists that take various forms depending on the requirements for the specific entry

$ For information on variables and macros, see the section "PowerDesigner variables". For
information on formatting lists for a specific entry, see the section for that entry.
If a value can fit on a single line, you can place it on the same line as the fieldname. If it requires
multiple lines, place the first line on a new line.
Examples

Single line value:


# Command for creating a table.
CreateTable = create table %TABLE%

Multi-line value:
# Command for dropping a database.
DropDatabase =
disconnect all;
dbtool drop database '%DATABASE%.db'

Reserved
characters

PowerDesigner has two reserved characters: # to mark the end of a parameter and % used by the
PowerDesigner variables. If you want to use one of these characters in the SQL syntax or in your
customization, it is necessary to double it.

Examples

Remark = %%% %REMARK%

The remark generated in the script has just two %% at the beginning:
%% Database name: PROJECT

PowerDesigner variables
PowerDesigner allows you to incorporate values from your model into your generated scripts. It
accomplishes this by providing a number of variables, that you can add to a DEF file. These
variables will be replaced with the actual values from your model when the scripts are generated.
PowerDesigner variables are written between percent signs (%), for example:
CreateTable = create table %TABLE%

Variable list
The variables that you can use in the DEF files are listed in the table that follows. If a variable
description indicates that it can be replaced by a name or code, the Use Name or Use Code radio
button selection in the Generation options dialog box determines the actual replacement value.
The evaluation of the variables depends on the parameters and the context. For example, the
%COLUMN% cannot be used in a CreateTablespace parameter, because this variable is only
known in a column parameter context.
Variables that are used in triggers are described in the triggers chapter of your PowerDesigner
User's Guide.

Variable

Description

Example or
comment

%DBMSNAME%

Name of the target database. This name is the


database name displayed in the target database
list and corresponds to the DbmsName variable
of the DEF file

Example: Sybase SQL


Server 10

%DATABASE%

Database name. This variable is replaced by the


model code or name if you generate the whole
model. It is replaced by the submodel code or
name if you generate the submodel only

Example: PROJECT

%DATE%

Generation date.

Example:
11/12/97 5:57 PM

%PATHSCRIPT%

Directory in which the database script is


generated

Example:
C:\PWRS\PD6\Script

%NAMESCRIPT%

Script file name

Example: crebas.sql

%STARTCMD%

Command for executing a script. This variable is


the value of the StartCommand parameter

Example: isql crebas.sql

%REMARK%

Remark automatically generated by


PowerDesigner

Comment: This variable


is equal to the Remark
parameter of the DEF
file

%COMMENT%

Table, view, or column comment. This variable


depends on the context. If you use it in a table or
in the TableComment parameter, it corresponds
to the label of the generated table

Example: The different


divisions of the
company.

%OID%

Object identifier. Each object (table, index,


column, view, etc.) has an internal object
identifier. This OID is a number unique for the
model. %OID% is equal to this number

Example: 355

%USER%

User name or code. This variable corresponds to


the author name or code of the model (Author
field of the model property sheet).

Example: User

This variable is replaced by the user of the


model if you generate the whole model. It is
replaced by the user of the submodel if you
generate the submodel only
%OWNER%

Owner name or code. The Owner is evaluated in


a table or view context

Example: dbo

%OWNERPREFIX%

Owner name or code, plus the period to separate


the owner and object name. The Owner is
evaluated in a table or view context

Example: dbo.

%OLDOWNER%

Old owner name or code. This variable is only


evaluated when you generate a modification
script after archiving, then modifying the model

Example: dbo

%OLDOWNERPREFIX%

Old owner name or code, plus the period to


separate the owner and the object name. This
variable is only evaluated when you generate a
modification script after archiving, then
modifying the model

Example: dbo.

%TABLESPACE%

Tablespace name or code

Example:
MY_TABLESPACE

%STORAGE%

Storage name or code

Example:
MY_STORAGE

%DOMAIN%

Domain name or code

Example: IDENTIFIER

%VIEW%

View name or code

Example:
QUICK_CUSTOMER

%VCODE%

View code

Example:
QUICK_CUSTOMER

%VNAME%

View name

Example: Quick
customer

%VLABL%

View label

Example: Short view for


customer information

%TABLE%

Table name or code

Example: CUSTOMER

%TCODE%

Table code

Example: CUSTOMER

%TNAME%

Table name

Example: Customer

Note: %TABNAME% is the same variable as


%TNAME%, but it is used only in the triggers
%TLABL%

Table label

Example: The Customer


table

%NEWTABL%

New table name or code. This variable is only


evaluated when you generate a modification
script after archiving, then modifying the model

Example:
NEW_CUSTOMER

%OLDTABL%

Old table name or code. This variable is only


evaluated when you generate a modification
script after archiving, then modifying the model.

Example: CUSTOMER

%COLNLIST%

Column list of a table. This variable lists the


column codes or names and separates them by a
comma.

Example: CUSNUM,
CUSNAME,
CUSADDR, CUSACT,
CUSTEL, CUSFAX

%COLUMN%

Column name or code

Example: CUSNUM

%COLN%

Column name or code

Comment: This is the


same as the
%COLUMN% variable

%CCODE%

Column code

Example: CUSNUM

%CNAME%

Column name. %COLNAME% is the same


variable as %CNAME%, but it is used only in
the triggers

Example: Customer
number

%CLABL%

Column label

Example: The identifier


of the customer in the
company

%COLNNO%

Column number. This variable corresponds to


the order number of the column in the table.
This number is displayed before the column
name in the list of columns of a table

Example: 1

%NO%

Serial number of an object category. This


variable computes a serial number per object
type. It is equal to %COLNNO% for the
columns of a table.

Example: 1

If you use %NO% in the constraint name


template such as FKConstraintName, it
computes the number of each foreign key of one
table

Example (in constraint


name template):
1 (for first foreign key
of Employee table);
2 (for second foreign
key of Employee table)

%DATATYPE%

Column data type with precision and length, if


they are defined for the column data type

Example: NUMERIC(5)

%LENGTH%

Column length.

Example: 5

%PREC%

Column precision

Example: 0

%ISPKEY%

This is a boolean variable. Its value is YES or


nothing (null). It is YES if the Primary key
checkbox is selected in the column definition

Example: YES

%ISMAND%

This is a boolean variable. Its value is YES or


nothing (null). It is YES if the Mandatory
checkbox is selected in the column definition

Example: YES

%NOTNULL%

The value for this variable is NULL or NOT


NULL, depending on the Mandatory checkbox.
If the checkbox is selected in the column
definition, the variable is equal to NOT NULL.
If the checkbox is not selected, it is equal to
NULL

Example: null

Note for Sybase and MS SQL Server:


%NOTNULL% also depends on the Identity
checkbox. If the Identity checkbox is selected,
%NOTNULL% is replaced by identity
%WITHDEFAULT%

If the With Default checkbox is selected in the


column definition., the value for this variable is
WITH DEFAULT. If the checkbox is not
selected, the variable has no value.

Example: with default

This checkbox appears for certain databases. It


depends on the EnableNotNullWithDflt
parameter in the DEF file

%UNIQUE%

UNIQUE if the column (primary key) or index is


unique. Nothing if the column or index is not
unique.

Example: unique

%MINVAL%

Minimum value. This value is entered in the


Minimum field of the Values group in the Check
Parameters window for a column

Example: 1

%LVAL%

(Old variable) Lower value

Comment: Same as
%MINVAL%

%MAXVAL%

Maximum value. This value is entered in the


Maximum field of the Values group in the
Check Parameters window for a column.

Example: 2000

%HVAL%

(Old variable) High value

Comment: Same as
%MAXVAL%

%MINMAX%

This is a SQL expression depending on the


minimum value and the maximum value. It
corresponds to the check constraint generated
when a minimum value and/or a maximum value
are defined

Example (minimum and


maximum value):
CUSNUM between 1
and 2000
Example (minimum
value only):
CUSNUM >= 1
Example (maximum
value only):
CUSNUM <= 1

%DEFAULT%

Default value, typed in the Default field of the


Values group in the Check Parameters window
of a column.

Example: 1

%DVAL%

(Old variable) Default value

Comment: Same as
%DEFAULT%

%DEFAULTCONST%

This is a complete SQL expression.


PowerDesigner builds a string containing the
default command plus the default value

Example: Default 1

%UNIT%

Unit typed in the Format field of the Parameters


group in the Check Parameters window of a
column.

Example: $

%FORMAT%

Format typed in the Format field of the


Parameters group in the Check Parameters
window of a column

Example: ####.##

%ISUPPER%

This is a boolean variable. Its value is YES or


nothing (null). It is YES if the Uppercase
checkbox of the Parameters group is selected in
the Check Parameters window of a column

Example: YES

%ISLOWER%

This is a boolean variable. Its value is YES or


nothing (null). It is YES if the Lowercase
checkbox of the Parameters group is selected in
the Check Parameters window of a column

Example: YES

%IDRDONLY%

This is a boolean variable. Its value is YES or


nothing (null). It is YES if the Cannot modify
checkbox of the Parameters group is selected in
the Check Parameters window of a column

Example: YES

%LISTVAL%

This is a SQL expression built from the List of


Values in the Check Parameters window for a
column.

Example:
CUSNUM in
(10,20,30,50,100)

%RULES%

The concatenation of all the validation rules and


the necessary parentheses. The rules are
separated by the selected operator (OR or AND)

Example:
((CUSACT like "BU
[0-9][0-9][0-9][0-9]")
or (CUSACT like
"[MT]C[0-9][0- 9]
[0-9][0-9]"))

%NEWCOLN%

New column name or code. This variable is only


evaluated when you generate a modification
script after archiving, then modifying the model.

Example:
NEW_CUSNUM

%OLDCOLN%

Old column name or code. This variable is only


evaluated when you generate a modification
script after archiving, then modifying the model

Example: CUSNUM

%INDEX%

Index name or code

Example:
CUSTOMER_PK

%ASC%

Depends on the Sort radio button of the column


list in the index definition. If the Ascending
radio button is selected for the column, it is
equal to ASC. It is equal to DESC when the
Descending radio button is selected

Example: ASC

%ISASC%

This is a boolean variable. Its value is YES or


nothing (null). It is YES if the Ascending radio
button is selected in the column definition of an
index

Example: YES

%CLUSTER%

This variable is replaced by the value of the


Cluster parameter. CLUSTER is its default value

Example for Sybase


System 11: clustered

%PKEYINDX%

Primary or nothing. Primary if the primary key


checkbox is selected for the index

Example: primary

%INDEXTYPE%

Index type. This variable corresponds to a


combination box in the index list of a table. The
index type names are listed in the IndexType
parameter

Example: btree

%PKEYLIST%

Primary key list. This variable lists the primary


key column codes or names and separates them
by a comma

Example: PRONUM,
TSKNAME, EMPNUM

%AKEY%

Alternate key name or code

Example:
CUSTOMER_AKEY1

%REFR%

Reference name or code

Example:
SUBCONTRACT
Maximum value

%CONSTNAME%

Constraint name or code. This variable is


evaluated in the alter table parameters and
depends on the constraint name templates

Example:
PK_CUSTOMER

%CONSTDEFINITION%

This is a SQL expression built from the Check


Parameters window for a column. It includes the
check keyword, the minimum value, the
maximum value, the list of values and the
validation rules

Example: check
(CUSNUM between 1
and 2000 and
CUSNUM in
(10,20,30,50,100) and
(CUSNUM != 500))

%PARENT%

Parent table name or code. In the reference


context, the %PARENT% table is the primary
key table.

Example: CUSTOMER

%CHILD%

Child table name or code. In the reference


context, the %CHILD% table is the foreign key
table.

Example: PROJECT

Variable macros
Variable macros allow you to perform string manipulation within a variable. They are implemented
by inserting codes into the variable after the initial percent sign. You embed formatting options in
variable syntax as follows:
%.format:variable%

The following list describes the formatting macros:


Macro

Description

Example

Result

.n:

Extracts the specified number of


characters from the variable.
This macro can be combined
with Justify, Lowercase,
Uppercase and Trim commands.

%.12:CNAME%

Customer Num is the


result for the Customer
Number column name

.L:

This will change all text to


lowercase and remove trailing
blanks

%.L:CNAME%

customer number is
the result for the
Customer Number
column name

.U:

This will change all text to


uppercase and remove trailing
blanks

%.U:CNAME%

CUSTOMER
NUMBER is the result
for the Customer
Number column name

.J:

This will left-justify the text in


the variable and leave trailing
blanks

Combined example:
%.20J:CNAME%

Customer Number
(with 5 trailing blanks)
is the result for the
Customer Number
column name

.T:

This will remove (trim) trailing


blanks

Combined example:
%.20T:CNAME%

Customer Number is
the result for the
Customer Number
column name (the
blanks added to make
20 characters are all
removed)

This will blank out the line


containing the variable if the
value of the variable is blank or
null*

.DEFINE "_DEFAULT"
"default(%?DEFAULT%)"

If %DEFAULT% is
null (the default value
field of the check
parameters is empty),
_DEFAULT is empty

* If the ? is not added in the variable definition and if %DEFAULT% is null (the default value field of the check
parameters is empty), _DEFAULT is equal to default(). With the ? character, _DEFAULT is empty.

General macros
Two macros are provided for defining your own variables for use in SQL scripts.

.DEFINE
The .DEFINE command is used to create a new variable and assign a default value to it.
Syntax:
.DEFINE "var_name" "value"

Example:
.DEFINE "TableName" "%USER%.%TABLE%"
drop table %TableName%

This code defines a new variable called Tablename and sets its default value to be the user ID and
the table name separated by a period.

.DEFINEIF
The .DEFINEIF command will conditionally set the value of a previously created variable to a
specified value. The conditional test is for a valid value or a null value. If a valid value is found,
the variable will be set. If a null value is found, the value will not be set. DEF file scripts are
executed from top down, with no branching, setting defaults first and then conditional values.
Syntax :
.DEFINEIF "test_string" " var_name" "value"

The test string is a PowerDesigner variable surrounded by percent marks.


Examples

Example 1: The following code defines a new variable called Case. Its initial value is nothing.
Then if the %ISUPPER% variable is YES, PowerDesigner will set the value of Case to be
"upper()". It then checks to see if the %ISLOWER% is YES, and if so, sets the value of Case to be
"lower()".
AddColtable =
.DEFINE "_CASE" ""
.DEFINEIF "%ISUPPER%" "_CASE" "upper()"
.DEFINEIF "%ISLOWER%" "_CASE" "lower ()"
%COLUMN% %_CASE%

Alternate method: If you know that the variable can only have one of two values, you can set the
default to one of the values and then only test for the other value.
AddColtable =
.DEFINE "_CASE" "lower()"
.DEFINEIF "%ISUPPER%" "_CASE" "upper()"
%COLUMN% %_CASE%

Example 2: This example uses the sense of the PowerDesigner reading (top down). If any column
has a default value defined in the check parameters, the column definition is followed by
default(defval), where defval is the value defined in the Default value field.
If there is no default value defined in the check parameters and if the column is not a primary key,
the column definition is followed by "with default". If there is no default value defined in the check
parameters and if the column is a primary key, the column definition is followed by nothing.
AddColtable =
.DEFINE "_DEFAULT" "with default"
.DEFINEIF "%ISPKEY%" "_DEFAULT" ""
.DEFINEIF "%DEFAULT%" "_DEFAULT" "default(%?DEFAULT%)"
%COLUMN% %DATATYPE% %_DEFAULT%

10

Note: The _DEFAULT is initialized with "with default". If the column is a primary key,
_DEFAULT is empty. If the column (primary key, foreign key or any other column) has a default
value, _DEFAULT is equal to default(defval).
Example 3: The following macro program comes from the AddColTable parameter of the
TERADATA.DEF file:
AddColTable =
.DEFINE "_LABEL" "title '%?CLABL%'"
.DEFINE "_RANGE" "%?MINVAL% to %?MAXVAL%"
.DEFINE "_DEFAULT" "default(%?DEFAULT%)"
.DEFINE "_FORMAT" "format '%?FORMAT%'"
.DEFINE "_CASE" ""
.DEFINEIF "%?ISUPPER%" "_CASE" "UPPERCASE"
.DEFINE "_COLOPT" "%_LABEL% %_RANGE% %_DEFAULT% %_FORMAT% %_CASE%"
%COLUMN% %DATATYPE% %NOTNULL% %.T:_COLOPT%

11

Field details
Database and target database identification
Header comments

File, Product, Database, and the Sybase Copyright on the first lines are header comments. There
are comment characters # at the beginning of each line.

Product
Description

PowerDesigner tests this field to insure the DEF file is for the product being used. There is a series
of DEF files for each product. DEF files for a particular database will probably be the same for all
products, but this allows us to program different functionality based on the product being used
and/or change the list of supported databases.

Example

Product

= PowerDesigner

Module
Description

When the variable is flagged WarehouseArchitect, the DataArchitect module ignores the DEF file.
The available database interface is listed when generating WAM file from a CDM file (or when
changing the target database from the WAM Dictionary menu).

Example

Red Brick Warehouse and Sybase IQ DEF files have the Module variable set as follows.
Module = WarehouseArchitect

The PDM generation from a DataArchitect CDM does not include RedBrick Warehouse or Sybase
IQ database interface in the available list.

Version
Description

The version defines the major release of PowerDesigner for which this DEF file was intended to
be used. The number of the version will normally change only for major release.

Example

Version

= 6.1

DbmsName
Description

This field represents the name of the database that will appears in the list of target databases. This
list appears when generating a PDM from a CDM, or when changing the target database from the
PDM. The list of the available target databases is constructed by scanning the specified
subdirectory for DEF files and then taking the DbmsName from each file and adding it to the list.

Example 1

In the SQLANY55DEF file:


DbmsName = Sybase SQL Anywhere 5.5

If you want to modify the DEF file in order to change the standard parameter setting, you should
copy the standard DEF file that you want to modify, and change the DbmsName in order to
recognize it among databases on the available list.
Example 2

If you create your own Sybase SQL Anywhere DEF file, MYSQLANY.DEF, you could set the
DbmsName field to a new value:
DbmsName = My updated SQLAnyWhere.

Then you will see the value My updated SQLAnyWhere in the list.

12

Updating the list of target databases

When you create your own DEF file, in order to see your own DbmsName on the list proposed
on the PDM, you must force PowerDesigner to rebuild its current DbmsName list. You can
either restart PowerDesigner, or from the ? button beside the available list, choose another
directory and click the OK button, then go back to the ? button and choose the real DEF
directory, with your DbmsName in the available list.
Although every effort was made to not hardcode any logic to the DbmsName, there are some cases
where this has occurred. See the section on Hard Coding to see where this has occurred.

DbmsAlias
Description

When hardcoding occurs it is usually based on this value. Many PowerDesigner functions are
based on the value set in this field. These functions are not limited to script generation, but also
control the way that reverse engineering and other functions operate. You should verify that this
value is not changed or you can set it to a value from one of the supplied DEF files.

Example

In the SQLANY55DEF file:


DbmsAlias= SQL ANYWHERE 5

Database characteristics definition


The following lists the database characteristics definition parameters, each provided with an
example taken from SQLANY5.DEF.

Terminator
Description

End of command character. This is the characters used to terminate commands. For example, the
create table, view, index, or the the open/close database commands

Example

Terminator = ;

BlockTerminator
Description

End of block character. This character ends the expression of triggers, stored procedures, views,
alter tables, and other SQL request of the modify script.

Example

BlockTerminator = /

UseBlockTerm
Description

Use end of block character. This field makes sense when the BlockTerminator variable has been
set.
Value

Result

Yes

The BlockTerminator character ends all the expressions, including triggers, stored procedures,
views, alter tables, and other SQL requests of modify script

No

View SQL expressions ignore the BlockTerminator character. Other expressions use it

Delimiter
Description

Field separation character. Example: col1, col2, col3

Example

Delimiter = ,

Columns will be seperated by a comma in the create table order.


13

create table CUSTOMER


(
CUSNUM
numeric(5)
CUSNAME char(30)
CUSADDR char(80)
CUSACT
char(80)
CUSTEL
char(12)
CUSFAX
char(12)
primary key (CUSNUM)
);

not null,
not null,
not null,
,
,
,

IdxDelimiter
Description

Example

Field separation character for index definition. When the index separation character is different
from the default delimiter defined for other orders, the DEF file mentions the specific field
IdxDelimiter.
DEF file parameter

Separation character used

Delimiter only

The character defined in the Delimiter field will separate index columns

Delimiter and IdxDelimiter

Index columns will be separated by the IdxDelimiter value and the


Delimiter character will separate other object fields

Delimiter and an empty


IdxDelimiter

Index columns will not be separated by any field and the Delimiter
character will separate other object fields

IdxDelimiter = + (Foxpro.DEF file)


index tag PRTCP_PK on STR(PRONUM)+ TSKNAME+ STR(EMPNUM)

KeyDelimiter
Description

This field is specific to Microsoft Access 1.0 and Microsoft Access1.1. This delimiter character is
used between primary key columns on parent table and foreign key columns on child tables to
specify the join when defining an Access reference.

Example

KeyDelimiter = !
AccCreateReference "RELATION_22", "PARTICIPATE", "PRONUM!TSKNAME",
"TASK", "PRONUM!TSKNAME"

Quote
Description

The character that is used to enclose string values. It is usually either a single or double quotation
mark.

Example

Quote = '

SqlContinue
Description

Continuation character. Some databases require a continuation character when commands span
more than a single line. This character, if present, will be appended to each line just prior to the
linefeed.

Example

SqlContinue = +
Rbase needs a character to specify a multiligne sql order:
create table TEAM +
( +
TEANUM
NUMERIC(5)
not null, +
TEASPE
CHARACTER(80)
, +
primary key (TEANUM) +
)

14

lllegalChar
Description

Invalid characters for names. This is only used for generation. The invalid characters for names and
codes are defined in the Model Options dialog box (Name page and Code page, respectively).

Example

IllegalChar = " +-*/!=<>'"()"

DefaultChar
Description

Default character. When PowerDesigner detects an illegal character in a Name or Code defined by
the user, it replaces this character by the default character. This replacement is automatically
applied when you press the = button in a name or code field.

Example

DefaultChar = "_"

MaxScriptLen
Description

Maximum length for a script line.

Example

MaxScriptLen = 72

In the DB2.DEF, the field is set to 72: DB2 MVS only supports 72 characters per script line.

MaxTableLen
Description

Maximum table code length supported by the target database. This is the maximum number of
characters supported by the database for the naming of the table codes.
The Check Model verifies each table code length and raises an error if the table has a code too long
for the target database.
Maximum length for names and codes:

PowerDesigner has a maximum length of 80 characters for names and codes. If your database
supports longer names, you will be limited by PowerDesigner to 80 characters.
Example

MaxTableLen = 128

MaxIndexLen
Description

Maximum index code length supported by the target database. This is the maximum number of
characters supported by the database for the naming of the index codes.
The Check Model verifies each index code length and raises an error if the index has a code too
long for the target database.
Maximum length for names and codes:

PowerDesigner has a maximum length of 80 characters for names and codes. If your database
supports longer names, you will be limited by PowerDesigner to 80 characters.
Example

MaxIndexLen = 128

MaxColumnLen
Description

Maximum column code length supported by the target database. This is the maximum number of
characters supported by the database for the naming of the column codes.
The Check Model verifies each column code length and raises an error if the column has a code too
long for the target database.

15

Maximum length for names and codes:

PowerDesigner has a maximum length of 80 characters for names and codes. If your database
supports longer names, you will be limited by PowerDesigner to 80 characters.
Example

MaxColumnLen = 128

MaxConstLen
Description

Maximum constraint name length supported by the target database. This is the maximum number of
characters supported by the database for the naming of the constraints.
Maximum length for contraint names:

PowerDesigner has a maximum length of 30 characters for constraint names. If your database
supports longer constraint names, you will be limited by PowerDesigner to 30 characters.
Example

MaxConstLen = 128

MaxColIndex
Description

Maximum number of columns allowed in an index in the target database. The Check Model
verifies and indicates an error if there are more columns included in the index definition than the
allowed number.

Example

MaxColIndex = 99

Header
Description

Script header. Anything added to this entry will be added at the beginning of the generated scripts.
You can place a header in your scripts to document or perform initialization logic.

Example 1

In the INGRES6.DEF file:


Header =
set autocommit on\g
set lockmode session where readlock=nolock, level=table\g

In the FOXPRO.DEF file:


Header = close database
Example 2

Header =
// PowerDesigner generated creation Script
// Generated from %DATABASE% for %DBMSNAME%
// File generated %NAMESCRIPT%
//

Replacing or enhancing standard titles:

PowerDesigner optionally generates titles which add standard documentation information to


your scripts files. This header can be used as a method of replacing the standard titles or
enhancing them. This header is placed after the standard title, but before any generated SQL
script.

Footer
Description

Script footer. Anything added to this entry will be added at the end of the generated scripts. You
can place a footer in your scripts to document or perform termination logic.

Example

In the INGRES6.DEF file:


Footer =
\q

16

CustomItem1
This field is specific to a few non-SQL databases (Microsoft Access 2.0, Access 95, and the Visual
Basic Professional and Enterprise versions). It helps to build the program for the creation of the
database structure.

CustomItem2
This field is specific to a few non-SQL databases (Microsoft Visual Basic Professional and
Enterprise versions). Since each DEF field has a limited length, the database structure program
defined in CustomItem1 field can continue in CustomItem2.

CustomItem3
This field is specific to a few non-SQL databases (Microsoft Visual Basic Professional and
Enterprise versions). Since each DEF field has a limited length, the database structure program
defined in CustomItem2 field can continue in CustomItem3.

CustomItem4
This field is specific to a few non-SQL databases (Microsoft Visual Basic Professional and
Enterprise versions). Since each DEF field has a limited length, the database structure program
defined in CustomItem3 field can continue in CustomItem4.

UpperCaseOnly
Description

Example

Uppercase only. When generating a script from PDM, all objects (tables, columns, constraint,
index, etc.) can have a specific case definition (uppercase, lowercase) different from the one
defined in the PDM and Model Options (uppercase, lowercase, or mixed case).
Value

Result

Yes

Forces all generated script characters to uppercase

No

Generates all script unchanged from the way objects are written in the model (uppercase,
lowercase or mixed case is kept)

UpperCaseOnly = NO

Sequential generation of DEF fields

The UpperCaseOnly field is ignored if UpperCaseOnly and LowerCaseOnly fields are both set
to Yes. In this case, PowerDesigner will overwrite UpperCaseOnly with the value of the
LowerCaseOnly field: the script will be generated in lowercase.

LowerCaseOnly
Description

Example

Lowercase only. This controls whether script other than table names and column names are in
lowercase only.
Value

Result

Yes

Forces all generated script characters to lowercase

No

Generates all script unchanged from the way objects are written in the model (uppercase,
lowercase or mixed case is kept)

LowerCaseOnly = NO

17

SQLSupport
Description

SQL syntax allowed for database creation or modification.


Value

Target database

Result

Yes

Supports SQL syntax

No specific treatment

No

Does not support SQL syntax

When you generate the database via an ODBC driver:

Example

If the DEF file has an associated DBC file,


PowerDesigner reads the DBC file for database
generation or modification
If the DEF file does not have an associated DBC file,
PowerDesigner reads the ODBC.DEF file for database
generation or modification

SQLSupport = YES

EnableTabPar
Description

Example

Are Parentheses allowed in "create table".


Value

Result

Yes

PowerDesigner generates statements between parentheses

No

PowerDesigner generates statements without parentheses

For the following SQLAnywhere 5.5 DEF file value:


EnableTabPar = YES

The following table will be generated:


create table DIVISION
(
DIVNUM
numeric(5)
DIVNAME
char(30)
DIVADDR
char(80)
primary key (DIVNUM)
);

not null,
not null,
,

For the following SQLAnywhere 5.5 DEF file value:


EnableTabPar = NO

The following table will be generated:


create table DIVISION
DIVNUM
numeric(5)
DIVNAME
char(30)
DIVADDR
char(80)
primary key (DIVNUM);

not null,
not null,
,

EnableNotNull
Description

18

NOT NULL keyword allowed.


Value

Target database

Result

Yes

Supports NOT NULL keyword

Mandatory columns will be generated as NOT NULL


Columns

No

Does not support NOT NULL


keyword

Column mandatory status will be ignored when generating


the database

Example

In the SQLAnywhere 5.5 DEF file:


EnableNotNull = YES

The following script is generated:


create table DIVISION
(
DIVNUM
numeric(5)
DIVNAME
char(30)
DIVADDR
char(80)
primary key (DIVNUM)
);

not null,
not null,
,

EnableNull
Description

Example

NULL keyword allowed.


Value

Target database

Result

Yes

Supports NULL keyword

Columns that are not checked Mandatory in the PDM will be


generated with NULL status

No

Does not support NULL


keyword

Columns that are not checked Mandatory in the PDM will be


generated without NULL status

For the Sybase SQL Server System 11 DEF file:


EnableNull = YES

where CUSACT, CUSTEL, CUSFAX are not mandatory columns, the null keyword is set beside
the column on the create table order.
create table CUSTOMER
(
CUSNUM
numeric(5)
CUSNAME
char(30)
CUSADDR
char(80)
CUSACT
char(80)
CUSTEL
char(12)
CUSFAX
char(12)
constraint PK_CUSTOMER primary key
)
go

not null,
not null,
not null,
null
,
null
,
null
,
(CUSNUM)

EnableNotNullWithDflt
Description

Does the database support Not Null With Default syntax in column definitions.
Value

Target database

Result

Yes

Supports Not Null With


Default syntax

An additional checkbox, With Default, appears in the List of


Columns. For each column:

No

Example

Does not support Not Null


With Default syntax

If the Mandatory checkbox is selected, the With Default


checkbox can be selected
If the Mandatory checkbox is not selected, the selection of
With Default checkbox is removed automatically. The
With Default checkbox cannot be selected

With Default checkbox is not visible

In the CA Open Ingres DEF file:


EnableNotNullWithDflt = YES

19

where the PK Division Number column of the Division table has its Mandatory checkbox and its
With Default checkbox selected, the database generation script is:
create table DIVISION
(
DIVNUM
NUMERIC(5)
not null with efault,
DIVNAME CHAR(30)
not null ,
DIVADDR CHAR(80)
,
constraint PK_DIVISION primary key (DIVNUM)
)

EnableIdentity
Description

Identity key field support. Identity columns are serial counters that the database maintains (Sybase
and Microsoft SQL Server). This will control whether the Identity checkbox on the column
properties window is enabled or not.
When the Identity checkbox is selected, the Identity keyword is generated in the script after the
column data type.
An identity column is always a not null column: when checking the Identity checkbox, the
Mandatory checkbox is automatically selected.
PowerDesigner controls:

Example

Only one identity column can be defined per table: when the identity is set for a column, other
columns of the table have their identity checkbox grayed
A foreign key cannot be an identity column: the checkbox is grayed
Identity is only supported by certain data types . When the Identity checkbox is selected for a
column which data type does not match with identity, the data type is automatically changed to
numeric. When the data type of an identity column is replaced by a data type that does not
match with identity, PowerDesigner displays the error message "Identity cannot be used with
the selected data type"

In Sybase SQL Server System 11


EnableIdentity=YES

The employee number column is an identity, the following script is generated:


create table EMPLOYEE
(
EMPNUM
numeric(5)
EMP_EMPNUM numeric(5)
DIVNUM
numeric(5)
EMPFNAM
char(30)
EMPLNAM
char(30)
EMPFUNC
char(30)
EMPSAL
numeric(8,2)
constraint PK_EMPLOYEE primary key
)
go

identity,
null
,
not null,
null
,
not null,
null
,
null
,
(EMPNUM)

EnableOption
Description

20

Physical options allowed in target database (model, table, index, alternate key, etc.). This applies
for exemple to database, tables, indexes, alternate keys. It also controls whether or not the Options
button on the object Properties is enabled or not.

Example

Value

Target database

Result

Yes

Supports physical options,


for example, Tablespaces,
Storages, or physical
options like pctfree,
fillfactor , etc.

The Options button is available

No

Does not support physical


options

The Options button not selectable. In the all the database


parameters windows (for generation, modification, etc.), the
Physical Options checkbox is grayed

EnableOption = YES

EnableIntegrity
Description

Example

Integrity constraints allowed. This controls whether the referential integrity checkboxes (for
primary, foreign, and alternate keys) in the database parameters window (for generation and
modification) are grayed or available.
Value

Result

Yes

Referential integrity checkboxes are available for database generation and modification

No

Referential integrity checkboxes are grayed for database generation and modification

EnableIntegrity = YES

EnablePrimKey
Description

Primary key allowed. This entry controls whether the Primary key option is enabled on the
Generate and Modify database windows.

Example

EnablePrimKey = YES

EnableFornKey
Description

Foreign key allowed. This entry controls whether the Foreign key option is enabled on the Generate
and Modify database windows.

Example

EnableFornKey = YES

EnableFkeyName
Description

Foreign key name allowed.


Value

Result

Yes

The foreign key constraint is generated with a specific name. This name is defined in the
DEF file with the constraint name template FKConstraintName
By default, the foreign key constraint name is FK_%OID%. It can be no longer than 8
characters

No
Example 1

The foreign key is generated without any specific name for the foreign key constraint

In the SQLBASEs.DEF file:


EnableFkeyName = YES

21

where the column Division number (DIVNUM) is a foreign key of the Employee (EMPLOYEE)
table and the foreign key constraint name is FK_345:
alter table EMPLOYEE
foreign key FK_345 (DIVNUM)
references DIVISION on delete restrict;
Example 2

In the SQLBASE5.DEF file:


EnableFKeyName = NO

where the foreign key does not have any constraint name:
alter table EMPLOYEE
foreign key (DIVNUM)
references DIVISION on delete restrict;
Example 3

The DEF variable EnableConstName has the same purpose as EnableFKeyName, extended to all
the constraints (primary, foreign, alternate keys, column and table constraints). If the DEF file uses
the two variables, the one set to YES will overwrite the other one.
EnableFKeyName = YES
EnableConstName = NO

The foreign key constraint name is generated. Other constraint names for primary keys, alternate
keys, and table and column checks, will not be generated.
EnableFKeyName = NO

Example 4

EnableConstName = YES

The foreign key constraint name is also generated. Other constraints will also be generated

PkInTable
Description

Example

Primary key created in table. This entry determines where primary keys will be defined in the SQL
script.
Value

Result

Yes

Primary keys included in the create table statement

No

Primary keys generated separately in an alter table statement

PkInTable = YES

FkInTable
Description

Example

Foreign key created in table. This entry determines where in the SQL script Foreign keys will be
defined.
Value

Result

Yes

Foreign keys included in the create table statement

No

Foreign keys generated separately in an alter table statement

FkInTable = NO

PKAutoIndex
Description

22

Primary key is auto-indexed. This option primarily determines whether to generate a Create Index
statement for every Primary key statement.

Value

Target database

Result

Yes

Automatically generates a
primary key index when
generating the primary key
statement

Primary key checkboxes under create table and create index


cannot be selected simultaneously in the database generation
or modification parameters.

Does not generate the


primary key indexes
automatically when
generating the primary keys

Primary key indexes have to be generated explicitly. Primary


key checkboxes of both create table and create index can be
selected simultaneously

No

Example

If you select the primary key checkbox under create index, the
primary key checkbox of the create table will automatically be
cleared, and vice versa

In the SQLANY55.DEF file:


PKAutoIndex = YES

FKAutoIndex
Description

Foreign key is auto-indexed. This option primarily determines whether to generate a Create Index
statement for every Foreign key statement.
Value

Target database

Result

Yes

Automatically generates a
foreign key index when
generating the primary key
statement

Foreign key checkboxes under create table and create index


cannot be selected simultaneously in the database generation
or modification parameters.

Does not generate the


foreign key indexes
automatically when
generating the foreign keys

Foreign key indexes have to be generated explicitly. Foreign


key checkboxes of both create table and create index can be
selected simultaneously

No

Example

If you select the foreign key checkbox under create index, the
primary key checkbox of the create table will automatically be
cleared, and vice versa

In the SQLANY55.DEF file:


FKAutoIndex = YES

EnableUniqConst
Description

Example

UNIQUE constraint (Alternate keys) allowed for tables.


Value

Target database

Result

Yes

Supports alternate keys

The alternate key checkbox of the create table can be selected


in the database generation and modification parameters
windows

No

Does not support alternate


keys

The alternate key checkbox of the create table is grayed in the


database generation and modification parameters windows

In the SQLANY55.DEF file:


EnableUniqConst = YES

23

If the alternate key {Division name (DIVNAME), Division number (DIVNUM)} has been defined
in the Division table, the create table includes the unique clause on those two columns:
create table DIVISION
(
DIVNUM
integer
DIVNAME
char(30)
DIVADDR
char(80)
primary key (DIVNUM),
unique (DIVNAME, DIVNUM)
);

not null,
not null,
,

EnableUserType
Description

Example

User defined data types allowed. YES/NO


Value

Result

Yes

The User-defined type checkbox for columns is available in the database generation and
modification parameters

No

The User-defined type checkbox for columns is grayed

EnableUserType = YES

MaxUserTypeLen
Description

Length of user defined data types

Example

MaxUserTypeLen = 30

UserTypeName
Description

Name of user-defined data types

Example

UserTypeName = T_%DOMAIN%

AddQuote
Description

Specifies whether PowerDesigner should place quote marks around table and column names.

Example

In PDOXWIN5.DEF (Paradox for Windows):


AddQuote = Yes

Tables and Columns in database generation script are defined between quotes:
newTab = create "DIVISION" as "Paradox" with
"DIVNUM"
: "N",
"DIVNAME"
: "A30",
"DIVADDR"
: "A80"
endCreate

EnableDefault
Description

Default allowed.
Value

Result

Yes

The default value is generated for each column whether or not the default value is defined.
The default value can be defined in the check parameters for each column.
The Default Value checkbox for columns must be selected in the database generation and
modification parameters windows

No

24

The Default Value checkbox in the database generation and modification parameters
windows is grayed. The default value cannot be generated

Example

In the SQLANY55.DEF file:


EnableDefault = YES

where the default value for the column employee function (EMPFUNC) is Technical Engineer, the
generated script will be:
create table EMPLOYEE
(
EMPNUM
numeric(5)
not null,
EMP_EMPNUM numeric(5)
,
DIVNUM
numeric(5)
not null,
EMPFNAM
char(30)
,
EMPLNAM
char(30)
not null,
EMPFUNC
char(30)
default 'Technical Engineer',
EMPSAL
numeric(8,2)
,
primary key (EMPNUM)
);

DefaultAtEnd
Description

The column default value is generated after the data type and the NULL/NOT NULL statement, at
the end of the column definition. YES/NO.

Example 1

In the SQLANY55.DEF file:


DefaultAtEnd = Yes

The default value of the column Division number (DIVNUM) is generated after the NOT NULL
statement:
create table DIVISION
(
DIVNUM
numeric(5)
DIVNAME char(30)
DIVADDR char(80)
primary key (DIVNUM)
);
Example 2

not null default 130,


not null,
,

In the SYSTEM11.DEF file:


DefaultAtEnd = NO

The default value of the column DIVNUM is generated before the NOT NULL statement:
create table DIVISION
(
DIVNUM
numeric(5)
DIVNAME char(30)
DIVADDR char(80)
constraint PK_DIVISION primary
)

default 130 not null,


not null,
null
,
key (DIVNUM)

ReservedDefault
Description

The ReservedDefault variable lists all the database reserved default values that PowerDesigner
must keep as database keywords. PowerDesigner will not add quotes between them. (Column
default values are defined in the column Check Parameters.)

Example

ReservedDefault =
NULL
AUTOINCREMENT
CURRENT DATE
CURRENT PUBLISHER
CURRENT TIME
CURRENT TIMESTAMP
CURRENT USER
USER

25

In the SQLANY55.DEF file, AUTOINCREMENT belongs to the ReservedDefault list. The


AUTOINCREMENT that has been defined in the column Division number (DIVNUM) Default
Check, is generated without quotes for SQLAnywhere database:
create table DIVISION
(
DIVNUM
integer not nulldefault
DIVNAME
char(30) not null,
DIVADDR
char(80)
,
primary key (DIVNUM)
);

AUTOINCREMENT,

Other DEF files, like SYSTEM11.DEF, for databases that do not support AUTOINCREMENT as
a reserved word, it will be generated between quotes:
create table DIVISION
(
DIVNUM
numeric default 'AUTOINCREMENT' not null,
DIVNAME char(30) not null,
DIVADDR char(80) null
,
constraint PK_DIVISION primary key (DIVNUM)
)
go

MaxDefaultLen
Description

Maximum length that the database supports for the name of the column Default name. This name is
only defined in the Sybase databases family syntax.

Example

MaxDefaultLen = 30

UddtDefaultName
Description

Name of the user data types Default name. When a domain has a specific default value defined in
its check parameters, Sybase databases create a name for this user data type default value.

Example

In the SYSTEM11.DEF file:


UddtDefaultName = D_%.28:DOMAIN%

The FunctionList domain has a default value defined in its check parameters: Technical Engineer.
The following SQL order will generate a default name for that default value:
create default D_Functionlist
as 'Technical Engineer'
go

ColnDefaultName
Description

The column default value is defined in the create table for Sybase SQL Server 4.x and Microsoft
SQL Server. When a column has a specific default value defined in its check parameters, these
databases create a name for this column default value.

Example

In the SYBASE.DEF file:


ColnDefaultName = D_%.19:COLUMN%_%.8:TABLE%

The column Employee function (EMPFUN) of the table Employee has the default value, Technical
Engineer. The column default name, D_EMPFUNC_EMPLOYEE, will be created:
create default D_EMPFUNC_EMPLOYEE
as 'Technical Engineer'
go
execute sp_bindefault D_EMPFUNC_EMPLOYEE, "EMPLOYEE.EMPFUNC"
go

26

EnableCheck
Description

Example

Does the database supports the Check .


Value

Result

Yes

The column and table checks can be generated

No

The column and table Check checkboxes are grayed in the database generation and
modification parameters windows. Columns and tables checks are not generated

In the SQLANY55.DEF file:


EnableCheck = YES

Two checks have beed defined on Project table:

The Project number (PRONUM) column value must be defined between 1 and 17.
The Start date (PROBEG) column value must be smaller than the End date (PROEND)
column value.
create table PROJECT
(
PRONUM
integer
not null
check (
PRONUM between 1 and 17),
CUSNUM
integer
not null,
EMPNUM
integer
,
PRONAME char(30)
not null,
PROLABL char(80)
,
PROBEG
timestamp
,
PROEND
timestamp
,
primary key (PRONUM),
check (
PROJECT.PROBEG < PROJECT.PROEND)
);

Check parameters

Check includes all checks parameters defined in the table or column default or additional
validation rules. It does not take into account the column default value which is treated
separately in the EnableDefault field.

CheckNull
Description

When a column is not mandatory and has check parameters defined, it explicitly verifies if a
column is NULL in the column check of the generated SQL order.

Example

In the SQLANY55.DEF file:


CheckNull = YES

The Employee number (EMPNUM) is an optional column on Project table. This column has a
validation rule: the employee number column value must be defined between 1 and 99999.
The column check includes a control for the possibility of a Null value in the validation rule.
create table PROJECT
(
PRONUM
integer
not null,
CUSNUM
integer
not null,
EMPNUM
integer
check (
EMPNUM is null or (EMPNUM between 1 and 99999)),
PRONAME char(30)
not null,
PROLABL char(80)
,
PROBEG
timestamp
,
PROEND
timestamp
,
primary key (PRONUM),
);

27

MaxRuleLen
Description

Maximum length that the database supports for the table or column Rule name. This name is only
defined in the Sybase databases family syntax.

Example

MaxDefaultLen = 30

UddtRuleName
Description

Name of the user data types Rule name. When a domain has a specific rule defined in its check
parameters, the Sybase databases family creates a name for this user data type rule value.

Example

In the SYSTEM11.DEF file:


UddtRuleName = R_%.28:DOMAIN%

The Domain_speciality domain, has to belong to a set of values. This domain check has been
defined in a validation rule. The SQL order will generate the rule name following the template
defined in the field UddtRuleName:
create rule R_Domain_speciality
as
(@Domain_speciality in
('Industry','Military','Nuclear','Bank','Marketing'))
go
execute sp_bindrule R_Domain_speciality, T_Domain_speciality
go

ColnRuleName
Description

The column check parameters are defined, in separate rules, in the create table for Sybase SQL
Server 4.x and Microsoft SQL Server. When a column has a specific rule defined in its check
parameters, these databases create a name for this column rule.

Example

In the SYBASE.DEF file:


ColnRuleName = R_%.19:COLUMN%_%.8:TABLE%

The column Speciality (TEASPE) of the table Team has a list of values defined in its check
parametres: Industry, Military, Nuclear, Bank, Marketing.
The following rule name, R_TEASPE_TEAM, will be created and associated with the TEASPE
column:
create rule R_TEASPE_TEAM
as
@TEASPE in
('Industry','Military','Nuclear','Bank','Marketing')
go
execute sp_bindrule R_TEASPE_TEAM, "TEAM.TEASPE"
go

EnableConstName
Description

28

Constraint name allowed.

Value

Result

Yes

The constraints will be generated with the constraint name if the associated object
generation is supported by the target database

No

Example1

Primary key constraint name will be generated, with the name defined in the
PKConstraintName field, if the EnablePrimKey is set to YES
Foreign key constraint name will be generated, with the name defined in the
FKConstraintName field, if the EnableFornKey is set to YES
Alternate key constraint name will be generated, with the name defined in the
FKConstraintName field, if the EnableUniqConst is set to YES
Column and table check constraint will be generated with the name defined in the
CKCConstraintName and CKTConstraintName fields, if the EnableCheck is set to YES

Constraint will be generated, without the constraint name defined in PowerDesigner, if they
are supported by the target database

In the SYSTEM11.DEF file:


EnableConstName = YES

The check on Speciality (TEASPE) column is generated with the specific name
CKC_TEASPE_TEAM:
create table TEAM
(
TEANUM int
not null,
TEASPE char(10)
null
constraint CKC_TEASPE_TEAM check (TEASPE in
('Industry','Military','Nuclear','Bank','Marketing')),
constraint PK_TEAM primary key (TEANUM)
)
go
Example2

In the SQLANY55.DEF file:


EnableConstName = NO

The check on Speciality (TEASPE) column is generated without any specific name:
create table TEAM
(
TEANUM integer
not null,
TEASPE char(10)
check (TEASPE is null or (TEASPE in
('Industry','Military','Nuclear','Bank','Marketing'))),
primary key (TEANUM)
);

UniqConstName
Description

UNIQUE constraint allowed for tables on the database. This is not implemented yet, but added in
the DEF file to prepare future enhancements that can be managed in the Check Model.
Value

Result

Yes

The constraint names must be unique in the entire database. For example, two tables cannot
have the same primary key constraint name

No

The constraint names do not need to be unique in the whole database

Constraint names include primary key, foreign key, alternate key, and table and column checks.
Example

UniqConstName = NO

29

ConstNameAtEnd
Description

Constraint name at the end. YES/NO


The constraint name, when the database supports its generation (see EnableConstName), can be
generated at the beginning or at the end of the constraint definition.

Example 1

In the ORACLE6.DEF file:


ConstNameAtEnd = YES

The primary key constraint name PK_TEAM is at the end of the primary key definition:
create table TEAM
(
TEANUM INTEGER
not null,
TEASPE CHAR(10)
primary key (TEANUM) constraint PK_TEAM,
);
Example 2

In the SYSTEM11.DEF file:


ConstNameAtEnd = NO

The primary key constraint name PK_TEAM is at the beginning of the primary key definition:
create table TEAM
(
TEANUM int
not null,
TEASPE char(10)
null
constraint PK_TEAM primary key (TEANUM),
)
go

PKConstraintName
Description

This field allows you to declare a customizable template for all the primary key constraint names of
a PDM.
For each table in a model, the primary key constraint name is defined in the table properties field
Primary Key Constraint Name. This constraint name will be generated in the database if the
database supports primary keys and constraint names (see the DEF variables EnablePrimKey and
EnableConstName).
Some PowerDesigner variables can be used to define the primary key constraint name:

Example

%OID%

: table oid

%TABLE% : table code

PKConstraintName = PK_%.U27:TABLE%

FKConstraintName
Description

This field allows you to declare a customizable template for all the foreign key constraint names of
a PDM. This constraint name will be generated in the database if the database supports foreign
keys and constraint names (see the DEF variables EnableFornKey and EnableConstName, and for
the SQLBASE6.DEF, EnableFKeyName).
Some PowerDesigner variables can be used to define the foreign key constraint name :

Example

30

%OID%
%REFR%
%NO%

: reference oid
: reference code
: reference number (between two tables)

%PARENT% : parent table


%CHILD% : child table

FKConstraintName = FK_%.U8:CHILD%_%.U9:REFR%_%.U8:PARENT%

Preventing identical constraint names

To ensure that you will not have two identical constraint names through the model, you can use
the OID or NO numbers inside the template.
For example: FKConstraintName = FK_%.U20:REFR%_%OID% if you use a database, where
the constraint name is unique through the database, or FKConstraintName =
FK_%.U20:REFR%_%NO% if you use a database where the constraint name should be unique
for a table.

AKConstraintName
Description

This field allows you to declare a customizable template for all the alternate key constraint names
of a PDM. The alternate key constraint name is defined at the table level (Alt. Keys button in the
table properties field, Constraint Name).
This constraint name is generated in the database if the database supports alternate keys and
constraint names (see the DEF variables EnableUniqConst and EnableConstName). Some
PowerDesigner variables can be used to define the alternate key constraint name:

Example

%OID%

: ak oid

%AKEY% : ak name
%TABLE% : table code
%NO%

: ak number

AKConstraintName = AK_%.U18:AKEY%_%.U8:TABLE%

CKCConstraintName
Description

This field allows you to declare a customizable template constraint name for column check
parameters, including standard check parameters and validation rules. Column check constraints
are defined at the column level (Check button in the column properties field, Constraint Name).
This constraint name is generated in the database if the database supports column checks and
constraint names (see the DEF variables EnableCheck and EnableConstName). Some
PowerDesigner variables can be used to define the column check constraint name:

Example

%OID%

: column oid

%COLN%

: column code

%TABLE% : table code


%NO%

: column number

CKCConstraintName = CKC_%.U17:COLN%_%.U8:TABLE%

CKTConstraintName
Description

This field allows you to declare a customizable template constraint name for table check
parameters. Table check constraints are defined at the table level (Check button in the table
properties field, Constraint Name).
This constraint name is generated in the database if the database supports table checks and
constraint names (see the DEF variables EnableCheck and EnableConstName). Some
PowerDesigner variables can be used to define the table check constraint name:

Example

%OID%

: table oid

%TABLE% : table code

CKTConstraintName = CKT_%.U26:TABLE%

31

EnableIndex
Description

Example

Index allowed.
Value

Target database

Result

Yes

Supports index generation

Checkboxes for indexes are available in the database


generation and modification parameters windows (Create
index, and below it, primary key, foreign key, alternate key,
other indexes and physical options, Drop index)

No

Does not support indexes

Checkboxes for indexes are grayed in the database generation


and modification parameters windows

EnableIndex = YES

EnableIndPar
Description

Example

Parentheses allowed in create index command.


Value

Result

Yes

Enumeration of the columns that compose the index is between parentheses

No

Enumeration of the columns that compose the index is defined without parenthesis

In the SQLANY.DEF file:


EnableIndPar = YES

The table TASK has a primary key index composed of two columns: Project number (PRONUM)
and Task name (TSKNAME).
create unique index PK_TASK on TASK (PRONUM asc, TSKNAME asc);

EnableUnique
Description

Example

Unique index allowed.


Value

Result

Yes

The unique clause is included when generating an index defined as unique in


PowerDesigner (the Unique checkbox is selected in the index definition)

No

The unique clause is not included when generating an index, even if it has been defined as
unique in PowerDesigner

EnableUnique = YES

EnableCluster
Description

Clustered index allowed.


Value

Result

Yes

The clustered clause is included when generating an index defined as clustered in


PowerDesigner (the Cluster checkbox is selected in the index definition)
The selection of the Other index checkbox in the database creation or modification
parameters window activates the generation or modification of clustered indexes

No

32

The clustered clause is not included when generating an index, even if it has been defined
as clustered in PowerDesigner

Example

In the SYSTEM11.DEF file:


EnableCluster = YES

A clustered index has been created on table Customer,including the three columns Customer
activity (CUSTACT), Customer number (CUSTNUM), Customer name (CUSTNAME):
create clustered index CUSTOMER_CLUSTER on CUSTOMER (CUSACT, CUSNUM, CUSNAME)
go

EnableAscDesc
Description

Example

ASC, DESC keywords allowed on index definition. Ascending or descending sorting is selected in
the index definition part. By default, the radio button is set on ascending sort.
Value

Target database

Result

Yes

Supports index columns


sorted in ascending or
descending order

The keyword ASC or DESC is generated when creating or


modifying the database

No

Does not support index


column sort

The keyword ASC or DESC is not generated when creating or


modifying the database

In the SQLANY55.DEF file:


EnableAscDesc = YES

When creating the primary key index on table Task, ascending sort has been choosen for column
Project number (PRONUM) and descending sort for column Task name (TSKNAME)
create index PK_TASK on TASK (PRONUM asc, TSKNAME desc);

EnableAlter
Description

Example

Alter table command allowed in the database. By default, the EnableAlter value is YES, and it can
be omitted in the DEF file.
Value

Target database

Result

Yes

Supports the alter table


statement for the database
modification

The Generate Script button in the database modification


parameters window is available

No

Does not support the alter


table statement

The Generate Script button in the database modification


parameters window is grayed. The Modify Database button is
still available, since ODBC drivers can follow other
procedures to generate an alter table statement to the database

In the SQLANY55.DEF file, when the alter statement is available, the Team table modification
(addition of the column Team Name) can be integrated in an alter table statement script:
alter table TEAM
add
TEANAME

character(30)

not null

UniqIndxName
Description

Unique index name.


Value

Result

Yes

Two table cannot have the same index name. The check model displays an error if different
indexes with same name or same code belong to the model

No

Each index name must be unique for a table, but two indexes can have the same name or
code in two different tables

33

Example

In the SQLANY55.DEF file:


UniqIndxName = YES

AlterAddConst
Description

Example 1

Add the Constraint keyword on foreign key creation in the alter table command when generating
the database.
Value

Result

Yes

The foreign key constraint is created in the alter table, with the Constraint keyword
explicitly included

No

The foreign key constraint is created in the alter table, without the Constraint keyword

In the INFMX7.DEF file:


AlterAddConst = YES

Script example obtained checking the foreign key checkbox of the table Project without checking
the create table checkbox, in the database generation parameters window:
alter table PROJECT
add constraint (foreign key (CUSNUM)
references CUSTOMER (CUSNUM) constraint FK_SUBCONTRA_186);
Example 2

Modified INFMX7.DEF file:


AlterAddConst = NO,

Script example obtained checking the foreign key checkbox of the table Project without checking
the create table checkbox, in the database generation parameters window:
alter table PROJECT
add (foreign key (CUSNUM)
references CUSTOMER (CUSNUM) constraint FK_SUBCONTRA_186);

EnableMultiFile
Description

Multi-script allowed. This variable acts on the availability of the One File Only checkbox in the
Generate database, Generate Triggers and Procedures, and Modify Database parameters windows.
Value

Result

Yes

The One File Only checkbox is available, one script will be created for each table, and a
general script will sum up all the single table script entries. Each single script has the table
name and the extension defined in TableExt DEF variable
The general script has the file extension described in the DEF variable ScriptExt, and its
name is customizable in the File Name field of the generation or modification parameters
windows. The default names are CREBAS for database generation, CRETRG for triggers
and procedures generation, and ALTER for database modification

No

The One File Only checkbox is grayed, and a unique script will include all the orders
The file extension is described in the DEF variable ScriptExt, and its name is customizable
in the File Name field of the generation or modification parameters window. The default
names are CREBAS for database generation, CRETRG for triggers and procedures
generation, and ALTER for database modification

Example

EnableMultiFile = YES

ScriptExt
Description

34

When generating the database or the triggers and procedures, when modifying the database, the
DEF variable ScriptExt defines the main script extension.

Example

ScriptExt = sql

TableExt
Description

When generating a database or triggers and procedures, or when modifying the database, without
checking One File Only checkbox, one script is generated for each table, with the file extension
defined in the DEF variable TableExt (see also EnableMultiFile).

Example

TableExt = sql

ReverseExt
Description

When reverse engineering a database using a script file, the DEF variable ReverseExt defines the
script extension. The file selection window allows you to choose a script file to reverse if its Files
of Type field has the type defined in the ReverseExt DEF variable.
The ReverseExt variable is only defined for databases for which the reverse script extension is not
identical to the generation script extension defined in the ScriptExt DEF variable, for example,
ACCESS95.DEF or AS400.DEF.
For other databases, the ScriptExt DEF variable is taken into account both for generation and
reverse.

Example

ReverseExt = sql

Database command definition parameters


The following lists the database command definition parameters, each provided with an example
taken from different DEF files.
These parameters correspond to the SQL syntax of the target database. The parameters are grouped
by category below.

Parameters to define a header and footer for SQL orders


TabIdxHeader
Description

Table and Index header. Anything added to this entry will be added before the title of the Create
Table statement. You can place a table header in your scripts to document or perform initialization
logic.

Example

TabIdxHeader = /* Database name: %DATABASE% */

TabIdxFooter
Description

Table and index footer. Anything added to this entry will be added after the last Create Index
statement of each table.

Example

TabIdxFooter = grant all on %TABLE% to public

TableHeader
Description

Table header. Anything added to this entry will be added before the Create Table statement and
after the table begin script. You can place a table header in your scripts to document or perform
initialization logic.

Example

Example for Sybase System 11:


35

TableHeader =
set quoted_identifier on
go

TableFooter
Description

Table footer. Anything added to this entry will be added after the physical options of the Create
Table statement and before the terminator. The end script is generated after the terminator of the
Create Table statement.

Example

Example for Teradata:


TableFooter = unique primary index (%?PKEYLIST%)

IndexHeader
Description

Index header. Anything added to this entry will be added before the Create Index statement. You
can place an index header in your scripts to document or perform initialization logic.

Example

IndexHeader = /* Table name: %TABLE% */

IndexFooter
Description

Table footer. Anything added to this entry will be added after the physical options of the Create
Index statement and before the terminator.

Example

Example for Teradata:


IndexFooter = on %TABLE%

AlterHeader
Description

Example

Alter script header. Anything added to this entry will be added at the beginning of the database
modification script. You can place a header in your scripts to document or perform initialization
logic.
AlterHeader =
/* Company: SYBASE */
/* Software: PowerDesigner DataArchitect */

AlterFooter
Description

Alter script footer. Anything added to this entry will be added at the end of the database
modification script. You can place a footer in your scripts to document or perform termination
logic.

Example

Example
AlterFooter = /* End of modification script */

AlterTableHeader
Description

Alter table header. Anything added to this entry will be added before the Alter Table statement.
You can place an alter table header in your scripts to document or perform initialization logic.

Example

AlterTableHeader = /* Table name: %TABLE% */

36

AlterTableFooter
Description

Alter table footer. Anything added to this entry will be added after the Alter Table statement and
before the terminator.

Examples

AlterTableFooter = /* End of alter statement */

Parameters to define the SQL syntax of target database statements


Single line
statement

A statement can be defined on a single line. In this case the statement syntax is entered just after
the = sign, on the same line as the parameter, as follows:
CreateTablespace = create dbspace %TABLESPACE%

Multi-line statement

A statement can also be defined on multiplelines. In this case, the statement syntax is entered on a
new line, as follows:
CreateDatabase =
dbtool create database %DATABASE%.db
transaction log to %DATABASE%.log

Empty parameters

If the parameter is empty (equal to nothing), the target database does not support the corresponding
SQL statement. An empty parameter has an impact on the user interface: the corresponding
checkbox in the Generate Database and Modify Database windows can be grayed.

Evaluation of
variables

The syntax entered by the user for these parameters must be the same as the syntax described in the
database SQL reference manual. In addition, PowerDesigner variables can be used in the statement
definition. PowerDesigner variables have surrounding % marks.
The evaluation of the variables depends on the parameters and the context. For example, the
%COLUMN% cannot be used in a CreateTablespace parameter, because this variable is only
known in a column parameter context.
The macros .DEFINE and .DEFINEIF and the variable macros can be used in these parameters.
The generation of the column and table check parameters, the unique constraint, the primary key
constraint, the foreign key constraint cannot be customized via the DEF file for the moment.

$ For more information, see the General formatting section, beginning on page 3.

Parameters for the database generation scripts


StartCommand
Description

Command for executing a script. This parameter is special. It corresponds to the %STARTCMD%
variable. The value of this variable depends on this parameters. The start command corresponds to
the command used by the target database to execute a SQL script.

Example

Example for Sybase System 11:


StartCommand = isql %NAMESCRIPT%

Remark
Description

Command for remarks. If the Add titles checkbox is selected in the Generation Options window,
this parameter generates comments before each important create statement.

Example

Example for Sybase System 11:


Remark = /* %REMARK% */

%REMARK% is automatically replaced by PowerDesigner. The text corresponding to this variable


cannot be customized. This parameter corresponds to the comments added in the generated script.
37

BeforeCreateDatabase
Description

This is a boolean parameter. It is equal to YES or NO. YES means that the Create Tablespace
statements and the Create Storage statements are generated before the Create Database statement.
NO means that the Create Tablespace statements and the Create Storage statements are generated
after the Create Database statement. The default value for this parameter is YES.

Example

Example for DB2 MVS version 4:


BeforeCreateDatabase = NO

CreateTablespace
Description

Command for creating a tablespace. If this parameter is empty, the Create Tablespace checkbox on
the Database page of the Generate Database window is grayed.

Example

Example for SQLAnywhere 5.5:


CreateTablespace = create dbspace %TABLESPACE%

The %TABLESPACE% variable is the name or code of the tablespace defined in the List of
Tablespaces window.

DropTablespace
Description

Command for dropping a tablespace. If this parameter is empty, the Drop Tablespace checkbox on
the Database page of the Generate Database window is grayed.

Example

Example for SQLAnywhere 5.5:


DropTablespace = drop dbspace %TABLESPACE%

The %TABLESPACE% variable is the name or code of the tablespace defined in the List of
Tablespaces window.

CreateStorage
Description

Command for creating a storage. If this parameter is empty, the Create storage checkbox in the
Database tab of the Generate database window is grayed.

Example

Example for Sybase System 11:


CreateStorage = execute sp_addsegment %STORAGE%, %DATABASE%,

The %STORAGE% variable is the name or code of the storage defined in the List of Storages
window.

DropStorage
Description

Command for dropping a storage. If this parameter is empty, the Drop storage checkbox in the
Database tab of the Generate database window is grayed.

Example

Example for Sybase System 11


DropStorage = execute sp_dropsegment %STORAGE%, %DATABASE%

The %STORAGE% variable is the name or code of the storage defined in the List of Storages
window.

CreateDatabase
Description

38

Command for creating a database. If this parameter is empty, the Create Database checkbox on the
Database page of the Generate Database window is grayed.

Example

Example for SQLAnywhere 5.5:


CreateDatabase =
dbtool create database '%DATABASE%.db' transaction log to
'%DATABASE%.log';
connect to '%DATABASE%.db' user "dba" identified by sql

The %DATABASE% variable is the name or code of the model defined in the Model property
sheet.

OpenDatabase
Description

Command for opening a database. If this parameter is empty, the Open Database checkbox on the
Database page of the Generate Database window is grayed.

Example

Example for Sybase System 11:


OpenDatabase = use %DATABASE%

The %DATABASE% variable is the name or code of the model defined in the Model property
sheet.

CloseDatabase
Description

Command for closing a database. If this parameter is empty, the Close Database checkbox on the
Database page of the Generate Database window is grayed.

Example

Example for Sybase System 11:


CloseDatabase =

DropDatabase
Description

Command for dropping a database. If this parameter is empty, the Drop Database checkbox on the
Database page of the Generate Database window is grayed.

Example

Example for for SQLAnywhere 5.5:


DropDatabase =
disconnect all;
dbtool drop database '%DATABASE%.db'

The %DATABASE% variable is the name or code of the model defined in the Model property
sheet.

CreateUserType
Description

Command for creating a user-defined data type or domain. If this parameter is empty, the Create
Data Type checkbox and the associated Check checkbox on the Database page of the Generate
Database window is grayed.
The user-defined data type definitions are hardcoded for Sybase System 10 and System 11, and for
Microsoft SQL Server, because of the identity constraint and the specific NULL/NOT NULL
management.

Example

Example for Sybase System 11:


CreateUserType = create datatype %DOMAIN% %DATATYPE% %NOTNULL% %DEFAULTCONST%

The %DOMAIN% variable is the name or code of the domain defined in the List of Domains
window. %DATATYPE% is the data type of the domain, %NOTNULL% is NULL or NOT
NULL, depending on the Mandatory option state of the domain.

39

DropUserType
Description

Command for dropping a user-defined data type or domain. If this parameter is empty, the Drop
Data Type checkbox on the Database page of the Generate Database window is grayed.
The user-defined data type definition are hardcoded for Sybase System 10 and System 11, and for
Microsoft SQL Server, because of the identity constraint and the specific NULL/NOT NULL
management.

Example

Example for Sybase System 11:


DropUserType=
if exists(select 1 from sysdomain where domain_name='%DOMAIN%') then
drop datatype %DOMAIN%
end if

The %DOMAIN% variable is the name or code of the domain defined in the List of Domains
window.

CreateTable
Description

Command for creating a table.

Examples

Example for Sybase System 11:


CreateTable = create table %OWNERPREFIX%%TABLE%

The %TABLE% variable is the name or code of the table defined in the List of Tables window or
in the Table property sheet.

AddColTable
Description

Command for adding a column in the Create table statement. This parameter defines the lines of
the Create Table statement. One line corresponds to a column definition.
There is no specific variable for the check parameters. If the database supports the check constraint
(EnableCheck=Yes), they are systematically added after the AddColTable parameter, .
This parameter can be customized. See the General Macro paragraph for more information.

Example

Example for Sybase System 11:


AddColTable = %COLUMN% %DATATYPE% %DEFAULTCONST% %NOTNULL%

%COLUMN% is the name or code of the column defined in the column list of the table,
%DATATYPE% is the data type of the column, %NOTNULL% is NULL or NOT NULL
depending on the Mandatory option state of the column.

TableComment
Description

Command for adding a table comment. The table comment is a SQL statement. It is not supported
by all RDBMS. If this parameter is empty, the Comment checkbox in the Create Table fields of the
Schema page of the Generate Database window is grayed.

Example

Example for SQLAnywhere 5.5:


TableComment = comment on table %OWNERPREFIX%%TABLE% is '%COMMENT%'

The %TABLE% variable is the name or code of the table defined in the List of Tables window or
in the Table property sheet. The %COMMENT% variable is the label defined in the Label field of
the table.

40

ColumnComment
Description

Command for adding a column comment. The column comment is a SQL statement. It is not
supported by all RDBMS. If this parameter is empty, the Comment checkbox of the Columns group
on the Schema page of the Generate database window is grayed.

Example

Example for SQLAnywhere 5.5:


ColumnComment = comment on column %OWNERPREFIX%%TABLE%.%COLUMN% is '%COMMENT%'

The %COLUMN% variable is the name or code of the column defined in the column list of the
table. The %COMMENT% variable is the label defined in the Label field of the column.

DropTable
Description

Command for dropping a table. If this parameter is empty, the Drop table checkbox on the Schema
page of the Generate Database window is grayed.

Example

Example for Sybase System 11:


DropTable =
if exists (select 1
from sysobjects
where name = '%TABLE%'
and
type = 'U')
drop table %OWNERPREFIX%%TABLE%

The %TABLE% variable is the name or code of the table defined in the List of views window or in
the table property sheet.

CreateIndex
Description
Example

Command for creating an index.


Example for Sybase System 11:
CreateIndex = create %UNIQUE% %CLUSTER% index %INDEX% on %OWNERPREFIX%%TABLE%

The %INDEX% variable is the name or code of the index defined in the List of Indexes window or
in the index list of a table.

AddColIndex
Description

Command for adding a column in the Create Index statement. This parameter defines each column
in the column list of the Create Index statement.

Example

Example for SQLAnywhere 5.5:


AddColIndex = %COLUMN% %ASC%

%COLUMN% is the name or code of the column defined in the column list of the table. %ASC%
is ASC or DESC depending on the Sort radio button state for the index column.

DropIndex
Description

Command for dropping an index. If this parameter is empty, the Drop Index checkbox on the
Schema page of the Generate Database window is grayed.

41

Example

Example for Sybase System 11:


DropIndex =
if exists (select 1
from sysindexes
where id
= object_id('%TABLE%')
and
name = '%INDEX%'
and
indid > 0
and
indid < 255)
drop index %TABLE%.%INDEX%

The %INDEX% variable is the name or code of the index defined in the List of Indexes window or
in the index list of a table.

Cluster
Description

Cluster keyword. If this parameter is empty, the default value of the %CLUSTER% variable is
CLUSTER.

Example

Example for Sybase System 11:


Cluster = clustered

The %CLUSTER% variable is equal to the value defined in this parameter.

IndexType
Description

Parameter to create a combination box in the index list of a table. Each index type must be entered
on a new line. If this parameter is empty, the combination box, called Type, in the index list of the
table is not available.

Example

Example for Unify 2000:


IndexType =
btree
hash
link

DefIndexType
Description

Default index type. This variable corresponds to one type only. This type must be listed in the
previous IndexType list. If no other type has been selected, this type is the default type of all the
indexes. If this parameter is empty, the default type of the index is (None).

Example

Example for Unify 2000:


DefIndexType = btree

CreateView
Description

Command for creating a view. If this parameter is empty, the Create View checkbox on the Schema
page of the Generate Database window is grayed.

Example

Example for Sybase System 11:


CreateView = create view %OWNERPREFIX%%VIEW%

The %VIEW% variable is the name or code of the view defined in the List of Views window or in
the View property sheet.

DropView
Description

42

Command for dropping a view. If this parameter is empty, the Drop View checkbox on the Schema
page of the Generate Database window is grayed.

Example

Example for Sybase System 11:


DropView =
if exists (select 1
from sysobjects
where name = '%VIEW%'
and
type = 'V')
drop view %OWNERPREFIX%%VIEW%

The %VIEW% variable is the name or code of the view defined in the List of Views window or in
the View property sheet.

ViewComment
Description

Command for adding a view comment. The view comment is a SQL statement. It is not supported
by all RDBMS. If this parameter is empty, the Comment checkbox of the Views group on the
Schema page of the Generate Database window is grayed.

Example

Example for Oracle 7.3:


ViewComment = comment on table %OWNERPREFIX%%VIEW% is '%COMMENT%'

The %VIEW% variable is the name or code of the view defined in the List of Views window or in
the View property sheet. The %COMMENT% variable is the label defined in the Label field of the
view.

ViewCheck
Description

Option for checking a view. This parameter depends on the With Check Option checkbox of the
view property sheet. If the checkbox is selected and if the ViewCheck parameter is not empty, the
value of ViewCheck is generated at the end of the view select statement and before the terminator.

Example

Example for SQLAnywhere 5.5:


ViewCheck = with check option

Generated script for example:


create view TEST as
select CUSTOMER.CUSNUM, CUSTOMER.CUSNAME, CUSTOMER.CUSTEL
from CUSTOMER
with check option;

Commit
Description

Command for the validation by OBDC. This command is generated at the end of the ODBC script
to validate the SQL orders.

Example

Example for SQLAnywhere 5.5:


Commit = commit

Parameters for the database modification scripts


RenameTable
Description

Command for renaming a table. This parameter is used in the database modification script when a
table has been renamed. If RenameTable is empty, the modify database process drops the foreign
key constraints, creates a new table with the new name, inserts the rows from the old table in the
new table, and creates the indexes and constraints on the new table.

43

Example

Example for Sybase System 11:


RenameTable = sp_rename %OLDTABL%, %NEWTABL%

The %OLDTABLE% variable is the name or code of the table defined in the List of Tables
window or in the Table property sheet before its renaming. The %NEWTABLE% variable is the
new name or code of the table defined in the List of Tables window or in the Table property sheet.

RenameColumn
Description

Command for renaming a column. This parameter is used in the database modification script when
a column has been renamed. The rename column statement defined in this parameter is a specific
SQL statement different from the alter table statement. It is not supported by all RDBMS.
If the rename column statement is an alter table statement, it must be defined in the
AltRenameColumn parameter. If RenameColumn is empty, the modify database process reads the
AltRenameColumn parameter.

Example

Example for Sybase System 11:


RenameTable = sp_rename "%TABLE%.%OLDCOLN%", %NEWCOLN%

The %OLDCOLN% variable is the name or code of the column defined in the column list window
of a table before its renaming. The %NEWCOLN% variable is the new name or code of the
column defined in the column list of the table.

AddColumn
Description

Command for adding a column. This parameter is used in the database modification script when a
column has been added in the table. The add column statement defined in this parameter is a
specific SQL statement different from the alter table statement. It is not supported by all RDBMS.
If the add column statement is an alter table statement, it must be defined in the AltAddColumn
parameter. If AddColumn is empty, the modify database process reads the AltAddColumn
parameter.

Example

Example for Sybase System 11:


AddColumn =

ModifyColumn
Description

Command for modifying a column. This parameter is used in the database modification script when
the column definition has been modified. The modify column statement defined in this parameter is
a specific SQL statement different from the alter table statement. It is not supported by all
RDBMS.
If the modify column statement is an alter table statement, it must be defined in the
AltModifyColumn parameter. If ModifyColumn is empty, the modify database process reads the
AltModifyColumn parameter

Example

Example for Sybase System 11:


ModifyColumn =

DropColumn
Description

44

Command for dropping a column. This parameter is used in the database modification script when
a column has been deleted in the table. The drop column statement defined in this parameter is a
specific SQL statement different from the alter table statement. It is not supported by all RDBMS.

If the drop column statement is an alter table statement, it must be defined in the AltDropColumn
parameter. If DropColumn is empty, the modify database process reads the AltDropColumn
parameter.
Example

Example for Sybase System 11:


DropColumn =

AlterTable
Description

Command for modifying a table. This parameter is the first part of the alter table statement. The
other parts depend on the actions: deletion, addition, modification and the object to which the
action is applied.
Other parameters (AltRenameColumn, AltAddColumn, AltDropColumn, AltModifyColumn,
AltModifyColnNull, AltModifyColnDflt, AltModifyColnChk, AltDropPrimKey, AltDropFornKey,
AltDropColnChk, AltDropTablChk, AltDropUnique) allow you to define these actions.

Example

Example for Sybase System 11:


AlterTable = alter table %OWNERPREFIX%%TABLE%

The %TABLE% variable is the name or code of the table defined in the List of Tables window or
in the Table property sheet.

AltRenameColumn
Description

Command for renaming a column in an alter table statement. This parameter is used in the database
modification script when a column has been renamed.
If AltRenameColumn is empty, the modify database process drops the foreign key constraints;
creates a temporary table with the same structure and columns as the table before the column
renaming; inserts the rows from the old table to the new temporary table; drops the actual table;
creates a new table with the renamed column; inserts the rows from the temporary table to the new
table; then creates the indexes and constraints on the new table.

Example

Example for SQLAnywhere 5.5:


AltRenameColumn = rename %OLDCOLN% to %NEWCOLN%

The %OLDCOLN% variable is the name or code of the column defined in the column list window
of a table before its renaming. The %NEWCOLN% variable is the new name or code of the
column defined in the column list of the table.

AltAddColumn
Description

Command for adding a column in an alter table statement. This parameter is used in the database
modification script when a column has been added in the table.
If AltAddColumn is empty, the modify database process drops the foreign key constraints; creates a
temporary table with the same structure and columns as the table before the column addition;
inserts the rows from the old table to the new temporary table; drops the actual table; creates a new
table with the added column; inserts the rows from the temporary table to the new table; then
creates the indexes and constraints on the new table.

Example

Example for SQLAnywhere 5.5:


AltAddColumn = add %COLUMN% %DATATYPE% %NOTNULL%

The %COLUMN% variable is the name or code of the column defined in the column list window
of a table. The %DATATYPE% variable is the data type of the new column.

45

AltModifyColumn
Description

Command for modifying a column in an alter table statement. This parameter is used in the
database modification script when the column definition has been modified in the table.
If AltModifyColumn is empty, the modify database process drops the foreign key constraints;
creates a temporary table with the same structure and columns as the table before the column
modification; inserts the rows from the old table to the new temporary table; drops the actual table;
creates a new table with the modified column; inserts the rows from the temporary table to the new
table; then creates the indexes and the constraints on the new table.

Example

Example for SQLAnywhere 5.5:


AltModifyColumn = modify %COLUMN% %DATATYPE% %NOTNULL%

The %COLUMN% variable is the name or code of the column defined in the column list window
of a table. The %DATATYPE% variable is the data type of the modified column.

AltDropColumn
Description

Command for dropping a column in an alter table statement. This parameter is used in the database
modification script when the column definition has been deleted in the table.
If AltDropColumn is empty, the modify database process drops the foreign key constraints; creates
a temporary table with the same structure and columns as the table before the column deletion;
inserts the rows from the old table to the new temporary table; drops the actual table; creates a new
table without the deleted column; inserts the rows from the temporary table to the new table; then
creates the indexes and the constraints on the new table.

Example

Example for SQLAnywhere 5.5:


AltDropColumn = delete %COLUMN%

The %COLUMN% variable is the name or code of the column defined in the column list window
of a table.

AltModifyColnNull
Description

Command for modifying the mandatory option (null/not null) in an alter table statement. This
parameter is used in the database modification script when the mandatory option has been modified
on a column.
If AltModifyColnNull is empty, the modify database process drops the foreign key constraints;
creates a temporary table with the same structure and columns as the table before the mandatory
option modification; inserts the rows from the old table to the new temporary table; drops the
actual table; creates a new table with the new Null/Not Null value for the modified column; inserts
the rows from the temporary table to the new table; then creates the indexes and the constraints on
the new table.

Example

Example for Oracle 7.3:


AltModifyColnNull = modify %COLUMN% %NOTNULL%

The %COLUMN% variable is the name or code of the column defined in the column list window
of a table. The %NOTNULL% variable is Null or Not Null depending on the mandatory option of
the modified column.

AltModifyColnDflt
Description

46

Command for modifying a column default value in an alter table statement. This parameter is used
in the database modification script when the default value of a column has been modified in the
table.

If AltModifyColnDflt is empty, the modify database process drops the foreign key constraints;
creates a temporary table with the same structure and columns as the table before the default value
modification; inserts the rows from the old table to the new temporary table; drops the actual table;
creates a new table with the new default value for the modified column; inserts the rows from the
temporary table to the new table; then creates the indexes and the constraints on the new table.
Example

Example for SQLAnywhere 5.5:


AltModifyColnDflt = modify %COLUMN% default %DEFAULT%

The %COLUMN% variable is the name or code of the column defined in the column list window
of a table. The %DEFAULT% variable is the new default value of the modified column.

AltModifyColnChk
Description

Command for modifying a column check in an alter table statement. This parameter is used in the
database modification script when the check parameters of a column have been modified in the
table.
If AltModifyColnChk is empty, the modify database process drops the foreign key constraints;
creates a temporary table with the same structure and columns as the table before the check
parameter modification; inserts the rows from the old table to the new temporary table; drops the
actual table; creates a new table with the new check parameters on the column; inserts the rows
from the temporary table to the new table; then creates the indexes and the constraints on the new
table.

Example

Example for SQLAnywhere 5.5:


AltModifyColnChk = modify %COLUMN% %CONSTDEFINITION%

The %COLUMN% variable is the name or code of the column defined in the column list window
of a table. The %CONSTDEFINITION% variable is the check constraint built from the new check
parameters.

AltDropColnChk
Description

Command for dropping a column check in an alter table statement. This parameter is used in the
database modification script when the check parameters have been removed on a column.
If AltDropColnChk is empty, the Modify database process drops the foreign key constraints;
creates a temporary table with the same structure and columns as the table before the check
parameter deletion; inserts the rows from the old table to the new temporary table; drops the actual
table; creates a new table without any check parameters on the modified column; inserts the rows
from the temporary table to the new table; then creates the indexes and the constraints on the new
table.

Example

Example for SQLAnywhere 5.5:


AltDropColnChk = modify %COLUMN% check null

The %COLUMN% variable is the name or code of the column defined in the column list window
of a table.

AltDropPrimKey
Description

Command for dropping a primary key in an alter table statement. This parameter is used in the
database modification script when the primary key has been removed.
If AltDropPrimKey is empty, the modify database process drops the foreign key constraints;
creates a temporary table with the same structure and columns as the table before the primary key
deletion; inserts the rows from the old table to the new temporary table; drops the actual table;
creates a new table without any primary key; inserts the rows from the temporary table to the new
table; then creates the indexes and the constraints on the new table.
47

Example

Example for SQLAnywhere 5.5:


AltDropPrimKey = delete primary key

AltDropFornKey
Description

Command for dropping a foreign key in an alter table statement. This parameter is used in the
database modification script when a foreign key has been removed.
If AltDropFornKey is empty, the modify database process creates a temporary table with the same
structure and columns as the table before the foreign key deletion; inserts the rows from the old
table to the new temporary table; drops the actual table; creates a new table without the foreign
key; inserts the rows from the temporary table to the new table; then creates the indexes and the
constraints on the new table.

Example

Example for SQLAnywhere 5.5:


AltDropFornKey = delete foreign key %CONSTNAME%

The %CONSTNAME% variable is the code of the foreign key defined in the Integrity property
sheet of a reference.

AltDropTablChk
Description

Command for dropping a table check in an alter table statement. This parameter is used in the
database modification script when a table check constraint has been removed.
If AltDropTablChk is empty, the modify database process creates a temporary table with the same
structure and columns as the table before the table check constraint deletion; inserts the rows from
the old table to the new temporary table; drops the actual table; creates a new table without the
table check constraint; inserts the rows from the temporary table to the new table; then creates the
indexes and the constraints on the new table.

Example

Example for SQLAnywhere 5.5:


AltDropTablChk = delete check

AltDropUnique
Description

Command for dropping a unique clause check in an alter table statement. This parameter is used in
the database modification script when a unique constraint (alternate key) has been removed.
If AltDropUnique is empty, the Mmodify database process creates a temporary table with the same
structure and columns as the table before the unique constraint deletion; inserts the rows from the
old table to the new temporary table; drops the actual table; creates a new table without the unique
constraint; inserts the rows from the temporary table to the new table; then creates the indexes and
the constraints on the new table.

Example

Example for SQLAnywhere 5.5:


AltDropUnique = delete unique (%COLNLIST%)

The %COLNLIST% variable is the list of the columns including in the unique constraint.

AltEnableAddPrimKey
Description

48

Primary key allowed in an alter table statement. This parameter is a boolean. It indicates if a
primary key can or cannot be added in a table using an alter table statement.

If AltEnableAddPrimKey is equal to NO, the modify database process drops the foreign key
constraints; creates a temporary table with the same structure and columns as the table before the
primary key addition; inserts the rows from the old table to the new temporary table; drops the
actual table; creates a new table with the new primary key column; inserts the rows from the
temporary table to the new table; then creates the indexes and the constraints on the new table.
Example

AltEnableAddPrimKey = YES

AltEnableAddFornKey
Description

Foreign key allowed in an alter table statement. This parameter is a boolean. It indicates if a
foreign key can or cannot be added in a table using an alter table statement.
If AltEnableAddFornKey is equal to NO, the modify database process does not generate anything.

Example

AltEnableAddFornKey = YES

AltEnableAddTablChk
Description

Table check constraint allowed in an alter table statement. This parameter is a boolean. It indicates
if a table check constraint can or cannot be added in a table using an alter table statement.
If AltEnableAddTablChk is equal to NO, the modify database process drops the foreign key
constraints; creates a temporary table with the same structure and columns as the table before the
table check constraint addition; inserts the rows from the old table to the new temporary table;
drops the actual table; creates a new table with the new table check constraint; inserts the rows
from the temporary table to the new table; then creates the indexes and the constraints on the new
table.

Example

AltEnableAddTablChk = YES

AltEnableAddColnChk
Description

Column check constraint allowed in an alter table statement. This parameter is a boolean. It
indicates if a column check constraint, built from the check parameters of the column, can or
cannot be added in a table using an alter table statement.
If AltEnableAddColnChk is equal to NO, the modify database process drops the foreign key
constraints; creates a temporary table with the same structure and columns as the table before the
column check constraint addition; inserts the rows from the old table to the new temporary table;
drops the actual table; creates a new table with the new column check constraint; inserts the rows
from the temporary table to the new table; then creates the indexes and the constraints on the new
table.

Example

AltEnableAddColnChk = NO

AltEnableAddUnique
Description

Unique clause allowed in an alter table statement. This parameter is a boolean. It indicates if a
unique constraint (alternate key) can or cannot be added in a table using an alter table statement.
If AltEnableAddUnique is equal to NO, the modify database process drops the foreign key
constraints; creates a temporary table with the same structure and columns as the table before the
unique constraint addition; inserts the rows from the old table to the new temporary table; drops the
actual table; creates a new table with the new unique constraint; inserts the rows from the
temporary table to the new table; then creates the indexes and the constraints on the new table.

Example

AltEnableAddUnique

= YES

49

Parameters to define the physical options


This part explains how to define the physical options in a DEF file and describes the following
parameters: TablespaceOption, StorageOption, DatabaseOption, TableOption, IndexOption,
PKeyOption, AKeyOption.
The physical options are the options such as pctfree, pctused, fillfactor, and partition.
These options are available in the Options windows (click the Options button from the object
property sheet to display this window) for the following objects:
Object

Available option parameter

model

DatabaseOption

table

TableOption and PKeyOption

index

IndexOption

alternate key

AKeyOption

Physical options are directly accessible in the List of Tablespaces (TablespaceOption) and in the
List of storages (StorageOption).
They are also displayed in the Default Physical Options window (except for DatabaseOption). The
table option window is displayed below:

The DEF file uses a particular syntax to define physical options.

How to define a physical option specified by a value


The edit field between the Option listbox and the Other Options textbox in the Options window is
useful when the physical option requires a value. This edit field is diplayed when the %d or %s
variable follows the physical option name in the DEF file.
%d: A numeric value follows the physical option. The user must enter a numeric value in the edit
field.
%s: A string follows the physical option. The user must enter a string in the edit field.
For example, the max_rows_per_page is an index physical option for Sybase System 11. This
option limits the number of rows per data page. The Sybase syntax is the following:
[with max_row_per_page = x]

where x is the number of rows specified by the user.


50

In the SYSTEM.DEF file, this option is defined as follows:


IndexOption =
with max_rows_per_page = %d

The %d and %s variables are not currently checked by PowerDesigner. Therefore it is possible to
use %s for a numeric value.
The %d and %s variables must be at the last position and they must not be followed by other
options.
For example, the following syntax is wrong:
on %s with override

PowerDesigner only displays on %s.

How to define a single physical option


The DEF file only contains the name of this physical option.
For example, it is possible to use the sorted_data physical option in the Create Index statement for
Sybase System 11.
The syntax is:
[sorted_data]

In the SYSTEM11.DEF file, this option is defined as follows:


IndexOption =
sorted_data

How to define a physical option without a name


A physical option without a name corresponds to a free text entered by the user. The free text
physical option has to follow an indicator between angle brackets, < and >. This indicator is a
word described the physical option to be entered.
For example, the syntax of a System 11 segment is the following:
sp_addsegment segmentname, databasename, devicename

The segmentname corresponds to the storage code defined in PowerDesigner. The databasename
corresponds to the model code. These two fields are automatically generated by PowerDesigner.
The devicename must be entered by the user. Thus the devicename becomes an option.
In the SYSTEM11.DEF file, this option is defined as follows:
CreateStorage = execute sp_addsegment %STORAGE%, %DATABASE%,
StorageOption =
<devname> %s

A physical option without name must be followed by the %d or the %s variable.

How to define a default value for a physical option


A physical option can have a default value. The Default= keyword is used to specify this value.
After the physical option name or after the %d or %s value, it is necessary to add a colon then
default=x, where x is the default value for the target database.
For example, the default value for max_row_per_page is 0. In the SYSTEM11.DEF file, this
default value is defined as follows:
IndexOption =
with max_rows_per_page = %d: default=0

The default value is displayed by default in the Options window.

51

How to define a list of values for a physical option


A physical option can correspond to a list of possible options. The List= keyword is used to specify
a such list. After the physical option name, or after the %d or %s value, it is necessary to add a
colon, then list= x | y | z where x, y and z are the possible values. The values are separated by the
| pipe character.
For example, the <duprow> option of a System 11 index corresponds to two mutually exclusive
options for creating a non-unique, clustered index.
The syntax is:
[ignore_dup_row | allow_dup_row]

In the SYSTEM11.DEF file, this list is defined as follows:


IndexOption =
<duprow> %s: list=ignore_dup_row | allow_dup_row

A combination box listing the values is displayed between the Option listbox and the Other Options
textbox.
Note: If Default= and List= are used at the same time, they must be separated by a comma.
For example, if ignore_dup_row is the default value for an index, the syntax used in the DEF file to
define this value is the following:
IndexOption =
<duprow> %s: default= ignore_dup_row, list=ignore_dup_row | allow_dup_row

The values defined in Default= and List= cannot be used with the %d or %s variable. For example,
the following syntax is not correct:
with %s: list= default fill factor percent %s | max_row_per_page %s

How to define a physical option corresponding to a tablespace or a storage


A physical option can use the tablespace code or the storage code: category=tablespace or
category=storage builds a list with all the tablespace or storage codes defined in the List of
Tablespaces or the List of Storages in PowerDesigner.
For example, the on segmentname index option specifies that the index is to be created on the
named segment. A Sybase segment corresponds to a PowerDesigner storage. The syntax is
on segmentname.
In the SYSTEM11.DEF file, this default value is defined as follows:
IndexOption =
on %s: category=storage

A combination box listing the storages is displayed between the Option listbox and the Other
Options textbox.

How to define a composite physical option


A composite physical option is a physical option that includes other options.
For example the syntax of the index options for Sybase is the following:
[with
{
{default fill factor percent | max_row_per_page}=x,
ignore_dup_key, sorted_data,
[ignore_dup_row | allow_dup_row]
} ]
[on segmentname]

The With physical option includes other options, separated by a comma. To define a composite
option, three keywords (composite=, separator=, and parenthesis=) and two brackets are
necessary.
52

Keyword

Value and result

composite=

If composite=yes, brackets can be used to define a complex physical option

separator=

If separator=yes, the options are separated by a comma


If separator=no, the options have no separator character. This is the default value

parenthesis=

If parenthesis=yes, the composite option is delimited by parentheses, including all the


other options, for example:
with (max_row_per_page=0, ignore_dup_key)
If parenthesis=no, nothing delimits the complex option. This is the default value

The above syntax is defined as follows in the DEF file:


with : composite=yes, separator=yes, parenthesis=no
{
max_rows_per_page=%d : default=0
default fill factor percent=%d : default=0
ignore_dup_key
sorted_data
<duprow> : list=ignore_dup_row | allow_dup_row
}
on %s : category=storage

Default= and/or List= can also be used with the composite=, separator= and parenthesis=
keywords. Category= can be used with the three keywords of a complex option.
For example, the DB2 index options contain the following composite option:
IndexOption =
using stogroup %s : category=storage, composite=yes, separator=no, parenthesis=no
{
}

How to repeat a composite option several times


Certain databases repeat a block of options, grouped in a composite option, several times. In this
case, the following line must be added before the end bracket, closing the composite option to be
repeated:
, : composite=no, separator=yes, parenthesis=no
For example, the Informix fragmentation options can be repeated n time.
IndexOption =
fragment by expression %s : composite=yes, separator=no, parenthesis=no
{
<frag-expression> %s
in %s
remainder in %s
, : composite=no, separator=yes
}

When you select the Use checkbox corresponding to the comma or the composite comma, the
block of options between the brackets is copied one time in the Options window as follows:
fragment by expression
{
<frag-expression>
in
remainder in
,
,
<frag-expression>
in
remainder in
,
}

If you select the Use checkbox of the last composite comma, the block is copied one time again,
and so on.

53

Example

This example comes from the DB2.DEF file and applies the previous explanations about the
physical option definition.
IndexOption =
using vcat %s
using stogroup %s : category=storage, composite=yes, separator=no, parenthesis=no
{
priqty %d : default=12
secqty %d
erase %s : default=no, list=yes | no
}
freepage %d : default=0
pctfree %d : default=10
gbpcache %s : default=changed, list=all | changed
CLUSTER : composite=yes, separator=no, parenthesis=yes
{
part %d
values : composite=yes, separator=no, parenthesis=yes
{
<constant> %d
, : composite=no, separator=yes, parenthesis=no
}
using vcat %s
using stogroup %s : category=storage, composite=yes, separator=no, parenthesis=no
{
priqty %d : default=12
secqty %d
erase %s : default=no, list=yes | no
}
freepage %d : default=0
pctfree %d : default=10
gbpcache %s : default=changed, list=all | changed
, : composite=no, separator=yes, parenthesis=no
}
subpages %d : default=4, list=1 | 2 | 4 | 8 | 16
bufferpool %s : list=BP0 | BP1 | BP2
close %s : default=yes, list=yes | no
dsetpass %s
defer %s : default=no, list=yes | no

User interface impacts


TablespaceOption
and StorageOption

If the TablespaceOption or StorageOption parameter is empty (has no physical options), the


corresponding list in PowerDesigner is grayed and there is no corresponding tab in the Default
options window.
For example, if the DEF file contains the following empty parameter:
TablespaceOption=

then the List of Tablespaces menu item is grayed in PowerDesigner.


TableOption and
IndexOption

If the TableOption and IndexOption parameters are empty, the Physical Options checkbox in the
Generate Database window and in the Modify Database window are grayed. In addition there is no
corresponding tab in the Default Physical Options window.
For example, if the DEF file contains the following empty parameter:
TableOption=

then the Physical options checkbox of the Generate Database window and the Modify Database
window is grayed in PowerDesigner.
DatabaseOption

If the DatabaseOption parameter is empty, the Physical Options checkbox on the Database page of
Generate Database window is grayed.

PkeyOption and
AKeyOption

If the PkeyOption and AKeyOption parameters are empty, there is no corresponding tab in the
Default Physical Options window.
For example, if the DEF file contains the following empty parameter:
PkeyOption=

then the Default Physical Options window does not have any Primary Key tab.

54

Tabs are displayed for the corresponding physical option that has a value. For example, if
TablespaceOption has values, the List of Tablespaces menu item is available and the Default
Physical Options window has a tab labeled Tablespace.

Parameters to define the default physical options


This part describes how to use the default option parameters: DefTablespaceOption,
DefStorageOption, DefDatabaseOption, DefTableOption, DefIndexOption, DefPKeyOption,
DefAKeyOption.
These parameters initialize the physical options used by default by the objects.
These options are available in the Options windows (click the Options button from the object
property sheet to display this window) of the the following objects:
Object

Available option parameter

model

DatabaseOption

table

TableOption and PKeyOption

index

IndexOption

alternate key

AKeyOption

Physical options are directly accessible in the List of Tablespaces (TablespaceOption) and in the
List of storages (StorageOption).
They are also displayed in the Default Physical Options window (except for DatabaseOption). The
physical options defined in the DefXXXOption parameters are displayed in the Options window,
with the Use option selected by default.
This concerns only the Default Physical Options window, the Options window of the new objects
(table, index, and so on), and the objects without already used physical options. The
DefXXXOption parameters correspond to the values of the physical options applied by default to
the objects.
Example

The syntax of the Index options in Sybase System 11 is the following:


IndexOption =
with : composite=yes, separator=yes, parenthesis=no
{
max_rows_per_page=%d : default=0
default fill factor percent=%d : default=0
ignore_dup_key
sorted_data
<duprow> : list=ignore_dup_row | allow_dup_row
}
on %s : category=storage

The user would like to have max_rows_per_page=1, sorted_data and ignore_dup_row on each
index by default.
The parameter corresponding to IndexOption is DefIndexOption. The definition of the default
index options follows the syntax of the DEF file but the %d and %s are replaced by the good
values:
DefIndexOption =
with
{
max_rows_per_page= 1
sorted_data
ignore_dup_row
}

55

These options appear in the Options window when a new index is created in a table or when the
indexes do not have any used physical options. They also appear in the Default Physical options
window as shown below:

Parameters to define the format of profiles used for test data generation
There are three parameters to define the format of the time and date profiles:
ODBCDateFormat
ODBCTimeFormat
ODBCDatetimeFormat

The characters to define time are H for the hours, M for the minutes and S for the seconds. These
characters must be in uppercase.
The characters to define date are d for the days, m for the months and y for the years. These
characters must be in lowercase.
Example

ODBCDatetimeFormat = {ts yyyy-mm-dd HH:MM:SS}

The default values for these parameters are the standard ODBC 2.0 values.
Parameter

Default format

ODBCDateFormat

{d yyyy-mm-dd}

ODBCTimeFormat

{t HH:MM:SS}

ODBCDatetimeFormat

{ts yyyy-mm-dd HH:MM:SS}

The test data generation process reads the DEF file and applies the format directly without adding
any other character.

Parameters to define select statement for reverse engineering via ODBC


The following parameters corresponds to select statements using the system tables. These select
statements are executed during the reverse engineering via an ODBC driver and they allow you to
retrieve physical options or constraints.
56

SQLTableOption
Description

SQL command for obtaining the table physical options when you reverse engineer a database via
an ODBC driver. This is a select statement on the system tables.
The select statement defined in the standard DEF files contains a maximum of three joins. The
reverse engineering speed depends on the number of joins.

Example

Example for Sybase System 11:

SQLTableOption =
select "on " + s.name + " with max_rows_per_page = " + convert(CHAR, i.maxrowsperpage)
from syssegments s, sysindexes i, sysobjects o
where o.name = '%TABLE%' and i.id= o.id and o.type = 'U' and i.indid<2 and i.segment = s.segment

SQLIndexOption
Description

SQL command for obtaining the index physical options when you reverse engineer a database via
an ODBC driver. This is a select statement on the system tables.
The select statement defined in the standard DEF files contains a maximum of three joins. The
reverse engineering speed depends on the number of joins.

Example

Example for Sybase System 11:

SQLIndexOption =
select "with max_rows_per_page= " + convert(CHAR, i.maxrowsperpage) + " on " + s.name
from syssegments s, sysindexes i, sysobjects o
where o.name = '%TABLE%' and i.name = '%INDEX%' and o.type = 'U' and i.id = o.id and i.indid>=2
and i.segment = s.segment

SQLAkeyOption
Description

SQL command for obtaining the alternate keys (unique constraint defined on a table) when you
reverse engineer a database via an ODBC driver. This is a select statement on the system tables.

Example

Example for Sybase System 11:


SQLAkeyOption =
select distinct i.name
from sysindexes i, sysobjects t, sysusers u
where ((i.status & 2048)=0) and ((i.status2 & 2)=2)
and (i.id=t.id) and (t.type='U')
and (t.name='%TABLE%') and (u.uid=t.uid) and (u.name='%USER%')

Parameters to define lists


This section describes the function parameters that are available in the DEF files.
These built-in functions fall into six categories corresponding to six DEF file parameters. It is not
possible to add a function category.
Function type

Parameter

Group functions

GroupFunc

Number functions

NumberFunc

Character functions

CharFunc

Date functions

DateFunc

Conversion functions

ConvertFunc

Other functions

OtherFunc

Functions are used to return information from the database. They are allowed anywhere an
expression is allowed. There is always only one function per line in the DEF file.
57

The examples used in this document are issued from the built-in functions supported by Oracle,
Sybase SQL Anywhere and Sybase System 11, DB2 MVS and DB2 CS, Informix and Access.
Example

Example for SQL Server 11 database:


GroupFunc =
avg()
count()
max()
min()
sum()

The functions appear in PowerDesigner in the Categories windows. You can use the procedures
below to display the available functions for a particular PowerDesigner functionality:

58

To display available functions for a Begin Script and End Script:

Select Dictionary List of Tables.

Select a table.

Click the Script button.

Click the Zoom button.

Category Functions Function categories.

To display available functions for a business rule Server Expression:

Select Dictionary List of Business Rules.

Select a rule.

Click the Define button.

Click the Client radio button to edit a server expression.

Click inside the Expression textbox.

Click the Zoom button.

Category Functions Function categories.

To display available functions for a view Select statement:

Select Dictionary Views List of Views.

Select a view.

Click the SQL button.

Category Functions Function categories.

To display available functions for a procedure:

Select Dictionary Triggers and Procedures List of Procedures.

Select a procedure or function in the list.

Click the Zoom button.

Category Functions Function categories.

To display available functions for a trigger template:

Select Dictionary Triggers and Procedures Trigger Templates.

Select a template in the list.

Select Current Model from the Apply To dropdown listbox to modify the template in the
current model only.

Click the Zoom button.

Category Functions Function categories.

To display available functions for a trigger template item:

Select Dictionary Triggers and Procedures Trigger Template Items.

Click a template item in the list.

Select Current Model from the Apply To dropdown listbox to modify the item in the current
model only.

Click the Zoom button.

Category Functions Function categories.

To display available functions for a trigger:

Select Dictionary Triggers and Procedures List of Triggers.

Click the One Table radio button.

Select a table from the dropdown listbox.

Click the All radio button.

Select a trigger in the list.

Click the Zoom button.

Category Functions Function categories.

To display available functions for domain or column check parameters:

Select Dictionary List of Columns.


or
Select Dictionary List of Domains.

Select a column or a domain from the list.

Click the Check button.

Select the Expression textbox.

Click the Zoom button.

Category Functions Function categories.

GroupFunc
Description

List of group (aggregate) functions. The group functions are used to summarize data over a group
of rows from the database. The groups are formed using the GROUP BY clause of the SELECT
statement.
Group functions are only allowed in the select list and in the HAVING and ORDER BY clauses of
a SELECT statement.They cannot be used in a WHERE clause.
Group functions follow the general form:
function_name ( [all

distinct] expression )

59

Standard group functions are listed below:


Function

Description

avg()

Returns the average of all values in the specified column or expression. You can
apply the AVG keyword only to number columns. Nulls are ignored unless every
value in the specified column is null. If every column value is null, returns a null
for that column

count()

Returns the number of rows in each group where the expression is not the NULL
value. Count can be used with all data types except text and image

list()

Returns a string containing a comma-separated list composed of all the values for
the string expression in each group of rows. Rows where the string expression is
the NULL value are not added to the list

max()

Returns the maximum expression value found in each group of rows. Rows where
expression is the NULL value are ignored*#

min()

Returns the minimum expression value found in each group of rows. Rows where
expression is the NULL value are ignored*#

sum()

Returns the total of the expression for each group of rows. Rows where the
expression is the NULL value are not included*

* Returns the NULL value for a group containing no rows.


# Can be used with numeric, character, and datetime columns. It cannot be used with bit columns

NumberFunc
Description

List of number (mathematical) functions. Number functions return values commonly needed for
operations on mathematical data. Number function names are not keywords.
The number functions take the general form:
function_name (arguments)

Standard number functions are listed below:


Function

Description

abs()

Returns the absolute value of a numeric expression. Results are of the same type
and have the same precision and scale as the numeric expression

cos()

Returns the cosine of a numeric expression in radians

mod()

Returns the remainder when the dividend is divided by the divisor. Division
involving a negative dividend will give a negative or zero result

pi(*)

Returns the constant value of 3.1415926535897936

sqrt()

Returns the square root of a numeric expression

CharFunc
Description

List of character (string) functions. The character functions operate on binary data, character
strings, and expressions. Character functions return values commonly needed for operations on
character data. Character function names are not keywords.
The string functions take the general form:
function_name (arguments)

60

Standard character functions are described below:


Function

Description

lcase()

Converts all characters in the string expression to lower case

left()

Returns the leftmost numeric expression characters of the string expression

length()

Returns the number of characters in the string expression. If the string expression
is of binary data type, the LENGTH function behaves as BYTE_LENGTH

ltrim()

Returns a string expression with leading blanks removed

substr()

Returns the substring of a string expression starting at the given start position
(origin 1). If the length is specified, the substring is restricted to that length.
Both start and length can be negative.A negative starting position specifies a
number of characters from the end of the string instead of the beginning*

* A positive length specifies that the substring adds length characters to the right of the starting position, while a negative
length specifies that the substring adds length characters to the left of the starting position.

DateFunc
Description

List of date functions. Date functions are used to manipulate date,time,datetime,timestamp values.
Date functions can take arguments and can be reserved keywords.
Standard date functions are described below.
Function

Description

Current_date

The current year, month and day represented in the DATE data type

Current_time

The current hour, minute, second, and fraction of a second represented in the TIME
data type#

Current_timestamp

Combines CURRENT DATE and CURRENT TIME to form a TIMESTAMP value


containing year, month, day, hour, minute, second and fraction of a second#

month()

Returns a number from 1 to 12 corresponding to the month of the given date

now(*)

Returns the current date and time. This is the historical syntax for CURRENT
TIMESTAMP

# Although the fraction of a second is stored to 6 decimal places, the current time is limited by the accuracy of the system
clock. Under DOS and Windows, the clock is only accurate to approximately 1/18th of a second, rounded to two decimal
places

ConvertFunc
Description

List of conversion functions. Data type conversion functions change expressions from one data
type to another. They can also specify new display formats for date and time information.
Standard conversion functions are described below.
Function

Description

cast()

Returns the value of an expression converted to the supplied data type

string()

Concatenates the strings into one large string. NULL values are treated as empty strings
(). Any numeric or date parameters are automatically converted to strings before
concatenation.
Can also be used to force any single expression to be a string by supplying that expression
as the only parameter

61

OtherFunc
Description

List of other functions. Other functions return special information from the database.
Standard functions of the Other functions category are described below.
Function

Description

isnull()

Same as the COALESCE function

sqlcode

Current SQLCODE value

sqlstate

Current SQLSTATE value

user

A string containing the user ID of the current connection

ListOperator
Description

The list of operators appears in the same Categories windows that you also use to display the list of
functions (you must select Category Operators Operator instead of selecting
Category Functions Function).

The list of operators is also available from the Query Editor. You can use the procedure below to
display the available operators from the Query Editor:

To display the list of operators in the Query Editor:

Select Dictionary Views List of Views.

Select a view.

Click the Query button.

Select the Having tab.


You can display the List of Operators from the dropdown listbox at the bottom of the dialog
box and between the two expression dropdown listboxes.

The ListOperators parameter lists the comparison operators, the relational operators, and the
logical operators.
Example

Example for SQL Server 11 database:


ListOperators =
=
!=
<>
>
!>
<
!<
>=
<=
not
in
not in
between
not between
exists
not exists
like
not like
is null
is not null
= any
<> any
> any
< any
>= any
<= any

62

= all
<> all
> all
< all
>= all
<= all

Data types translation tables


PowerDesigner supports both conceptual and physical data types. A CDM uses conceptual data
types that are not DBMS-specific. A PDM uses physical data types that are DBMS-specific.
Some conceptual data types are not supported by certain DBMSs. Therefore a data type translation
must occur when the PDM is generated. The DEF file defines translations between conceptual data
types and physical data types.
For the exact correspondence between the PowerDesigner data type and the physical data type for
the chosen DBMS, you can refer to the List of Data Types section in the DEF file for that DBMS
(see AmcdDataType and PhysDataType below). If you want to modify the definition of an existing
physical data type, you can make the modification directly in the DEF.
If you are upgrading PowerDesigner

When you upgrade PowerDesigner, the existing DEF files are removed and replaced by the new
ones. To save modifications that you made to an existing DEF file, you must change the file
name and change the DbmsName parameter (for example : DbmsName = My Database). The
DbmsName is found at the beginning of the DEF file and must be unique..

Translating conceptual data types


This is the list of the conceptual data types to which the DEF file assigns translations.
Numeric data types

Numeric data types are described in the table below:


Data type

Description

Integer (I)

Can store 32-bit integer numbers. Depending on the DBMS, short and long
integers can be stored in the same way.
Any precision and length can be entered for this data type in the Standard Data
Types dialog box

Short Integer (SI)

Can store 16-bit integer numbers. It can be equal to the Integer data type if the
Short Integer data type is not supported in the target DBMS

Long Integer (LI)

Can store 64-bit integer numbers. It can be equal to the Integer data type if the
target DBMS does not support the Long Integer data

Number (N)

Can store numbers with a fixed decimal point. The length is specified in the
Length field and the precision in the Precision field of the Standard Data Types
dialog box. This data type can be equal to the Decimal data type for certain
DBMSs

Byte (BT)

Can store at least 256 values. If the target DBMS does not support this data
type, a translation is made to the Number data type with a length of 3. The
translation can also be made to the Short Integer data type.
A length can be entered for this data type in the Standard Data Types dialog box

Decimal (DC)

Can store numbers with a fixed decimal point. The length is specified in the
Length field and the precision in the Precision field of the Standard Data Types
dialog box. This data type can be equal to the Number data type for certain
DBMSs

Float (F)

Can store 32 bit floating decimal point numbers. If you enter a length for this
data type, it defines the storage of the Float data type in the DBMS

63

Data type

Description

Short Float (SF)

Can store floating decimal point numbers of less than 32 bits. This data type can
be equal to the Float data type if there is no Short Float

Long Float (LF)

Can store 64 bit floating decimal point numbers (double precision for 15 or 16
digits depending on the DBMS). This data type can be equal to the Float data
type if there is no Short Float in the target DBMS

Money (MN)

You can specify the length and the precision for this data type in the Length and
Precision fields of the Standard Data Types dialog box. The default length is 8
and the default precision is 2.
The translated representation of money depends upon the target DBMS. If the
target DBMS does not support the money data type, a translation to the Number
data type is performed for the PDM generation

Character data
types

Serial (NO)

Can store serial numbers that are incremented automatically.The length is


specified in the Length field of the Standard Data Types dialog box, and has a
default value of 6. If the target DBMS does not support this data type, a
translation to the Number data type is performed for the PDM generation

Boolean (BL)

Corresponds to two opposing values (true/false; yes/no; 1/0 ). If the targeted


DBMS does not support this data type, a translation to the Number data type
with a length of 1 is performed for the PDM genreation

Character data types are described in the table below:


Data type

Description

Characters (A)

Can store character strings with a fixed length that you can specify in the
Length field of the Standard Data Types dialog box

Variable Characters (VA)

Can store character strings with a variable length that does not surpass the
specified value in the Length field of the Standard Data Types dialog box.
The variable length allows you to ignore certain characters, such as spaces at
the end of a string.
This data type can be equal to the Characters data type with a length of 255
bytes for certain DBMSs

64

Long Characters (LA)

Can store character strings longer than 255 bytes with a fixed length that
you can specify in the Length field. This data type is target-specific.If the
target DBMS does not support this data type, a translation to the Variable
Characters data type is performed for the PDM generation

Long Var Characters (LVA)

Can store character strings longer than 255 bytes with a variable length in
the length field. The variable length allows you to ignore certain characters
such as spaces at the end of a string. This data type is target-specific. If the
target DBMS does not support this data type, a translation to the Long
Characters data type is performed for the PDM generation.

Text (TXT)

Can store character strings of variable length that are longer than 255
characters. It is target-specific. If the target DBMS does not support this
data type, a translation to the Long Characters data type is performed for the
PDM generation

Multibyte (MBT)

Can store multibyte character strings with a fixed length specified in the
Length field of the Standard Data Types dialog box. This data type can be
equal to the National character if it is supported by the target DBMS. If the
database does not support this data type, a translation to the Characters data
type is performed for the PDM generation

Variable Multibyte (VMBT)

Can store multibyte character strings with a variable length that does not
surpass the specified value in the Length field of the Standard Data Types
dialog box. This data type can be equal to the National variable character if
the target DBMS supports it. If the database does not support this data type,
a translation to the Variable Characters data type is performed for the PDM
generation

Time data types

Other data types

No length or precision can be entered for these data types. Time data types are described in the
table below:
Data type

Description

Date (D)

Can store the date in the day, month, and year format. For PDM generation, the Date
data type is translated into the date format of the target DBMS. If the target DBMS
does not support Date, it will be translated into a character string with a length of 8

Time (T)

Can store time with the hour, minute, and seconds format. The representation format
equals the format of the target DBMS. If the target DBMS does not support this data
type, a translation to the Date data type is performed for the PDM generation

Date & Time (DT)

Formats the date and time. It is DBMS-specific. If the target DBMS does not support
this data type, a translation to the Date data type is performed for the PDM
generation

Timestamp (TS)

Represents the system date and time. It is DBMS-specific. If the target DBMS does
not support this data type, a translation to the Date data type is performed for the
PDM generation

Data types of the Other data type category are described in the table below:
Data type

Description

Binary (BIN)

Can store binary strings with a length specified in the Length field of the Standard
Data Types dialog box.
The binary data type results in information that cannot be converted to another
data type. If the target DBMS does not support this data type, a translation to the
Text data type is performed for the PDM genreation

Long Binary (LBIN)

Can store binary strings of fixed length. It is DBMS-specific.If the target DBMS
does not support this data type, a translation to the Binary data type is performed
for the PDM genreation

Image (PIC)

Can store images. If the target DBMS does not support this data type, a translation
to the Long Binary data type is performed for the PDM generation

Bitmap (BMP)

Can store images in the bitmap format. If the target DBMS does not support this
data type, a translation to the Long Binary data type is performed for the PDM
generation

OLE (OLE)

Can store data concerning OLE links. If the target DBMS does not support this
data type, a translation to the Long Binary data type is performed for the PDM
genreation

Other (*)

Designates all other user defined data types. The default data type is a character
with a length of 10.
A new data type can be defined in the List of Data Types section of the DEF file
for the target DBMS. At the end of this section, after the definition of all the data
types, you can add the necessary lines to define any new data types*

Undefined <UNDEF>

Designates a not yet defined data type

* For example, if the target database is Oracle7, to define a DESCRIPTION type , you should add the following line in the
Oracle7.DEF: DESCRIPTION = VARCHAR(20). Then you could use this data type in the CDM by selecting the Other
data type and by entering DESCRIPTION in the Code field of the Standard Data Types dialog box

Translating conceptual data types to target database data types


Description

The DEF file lists the correspondence between PowerDesigner conceptual data types and the target
database data types. This list is used for PDM generation from a CDM.
In the DEF file, the data types before the = sign are the conceptual data types. The data types after
the = sign are the target database data types.

65

Example

Example for SQL Server 11 database:


AmcdDataType =
<UNDEF> = <undefined>
A%n
= char(%n)
VA%n
= varchar(%n)
LA
= varchar(255)
LA%n
= varchar(%n)
LVA
= varchar(255)
LVA%n
= varchar(%n)
BT
= tinyint
BT%n
= tinyint
SI
= smallint
I
= int
LI
= int
N
= numeric
N%n
= numeric(%n)
N%s,%p = numeric(%s,%p)
DC
= decimal
DC%n
= decimal(%n)
DC%s,%p = decimal(%s,%p)
SF
= real
F
= float
F%n
= float(%n)
LF
= double precision
MN
= money
MN%n
= money
MN%s,%p = money
D
= datetime
T
= datetime
DT
= datetime
TS
= timestamp
BL
= bit
NO
= numeric
NO%n
= numeric(%n)
BIN%n
= binary(%n)
LBIN
= varbinary(255)
LBIN%n = varbinary(%n)
TXT
= text
TXT%n
= text
MBT
= nchar(255)
MBT%n
= nchar(%n)
VMBT
= nvarchar(255)
VMBT%n
= nvarchar(%n)
PIC
= image
PIC%n
= image
BMP
= image
BMP%n
= image
OLE
= image
OLE%n
= image
*
= char(10)

Translating target database data types to conceptual data types


Description

The DEF file lists the correspondence between the target databases data types and the
PowerDesigner conceptual data types. It is used for Reverse Engineering, for the generation of a
CDM from a PDM, and for listing physical data types.
The data types before the = sign are the target database data types. The data types after the = sign
are the PowerDesigner conceptual data types.

Example

Example for SQL Server 11 database:


PhysDataType =
<undefined>
char(%n)
nchar(%n)
varchar(%n)
nvarchar(%n)
sysname
tinyint

66

=
=
=
=
=
=
=

<UNDEF>
A%n
MB%n
VA%n
VMB%n
VA30
BT

smallint
int
integer
numeric
numeric(%n)
numeric(%s,%p)
dec
dec(%n)
dec(%s,%p)
decimal
decimal(%n)
decimal(%s,%p)
real
float
float(%n)
double precision
smallmoney
money
smalldatetime
datetime
timestamp
bit
binary(%n)
varbinary(%n)
text
image
*

=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=

SI
I
I
N
N%n
N%s,%p
DC
DC%n
DC%s,%p
DC
DC%n
DC%s,%p
SF
F
F%n
LF
MN
MN
DT
DT
TS
BL
BIN%n
LBIN%n
TXT
PIC
A10

Translating target database data types to ODBC data types


Description

This DEF file lists the correspondence between the target database data types and ODBC data
types. The list is used for generation via an ODBC driver.
The data types before the = sign are the target database data types. The data types after the = sign
are the ODBC data types.
The ODBC data types are the data types listed in Intersolv drivers and in the ODBC driver of the
target database constructor. The core ODBC drivers use their own data types and do not recognize
all the target database types.

Example

Example for SQL Server 11 database:


PhysOdbcDataType =
sysname
= sysname(30)
nvarchar(%n)
= nvarchar(%n)

Translating ODBC data types to target databases data types


Description

The DEF file lists the correspondence between ODBC data types and the target database data
types. The list is used for Reverse Engineering using an ODBC driver.
The data types before the = sign are the ODBC drivers data types. The data types after the = sign
are the target database data types.

Example

Example for SQL Server 11 database:


OdbcPhysDataType =
sysname(%n)
= sysname
tinyint(%n)
= tinyint
smallint(%n)
= smallint
int(%n)
= int
integer(%n)
= integer
real(%s,%p)
= real
real(%n)
= real
double precision(%n)
= double precision
double precision(%s,%p) = double precision
smallmoney(%n)
= smallmoney
smallmoney(%s,%p) = smallmoney
money(%n)
= money
money(%s,%p)
= money

67

smalldatetime(%n)
datetime(%n)
timestamp(%n)
bit(%n)
text(%n)
image(%n)

=
=
=
=
=
=

smalldatetime
datetime
timestamp
bit
text
image

Translating target database data types to trigger data types


Description

This table lists the correspondence between the target database data types and the trigger data
types. These data types are described in the target database documentation. In general this list
restricts the data types used by the triggers.

Example

Example for Oracle 7 database:


HostDataType =
CHAR
= char
CHARACTER
= char
CHAR(%n)
= varchar
CHARACTER(%n) = varchar
CHARACTER VARYING(%n) = varchar
CHAR VARYING(%n) = varchar
VARCHAR(%n)
= varchar
VARCHAR2(%n) = varchar
LONG
= long
LONG VARCHAR = long
SMALLINT
= integer
INT
= integer
INTEGER
= integer
REAL
= number
DOUBLE PRECISION = number
DEC
= number
DEC(%n)
= number
DEC(%s,%p)
= number
DECIMAL
= number
DECIMAL(%n)
= number
DECIMAL(%s,%p)= number
NUMBER
= number
NUMBER(%n)
= number
NUMBER(%s,%p) = number
FLOAT
= float
FLOAT(%n)
= number
DATE
= date
RAW(%n)
= raw
LONG RAW
= raw

Storage size of a target database data type for Compute Database Size
Description

Usually the data types have a default length. When this is not the case, the data type is added to a
DEF file list with a size to be used for computational purposes.

Example

Example for SQL Server 11 database:


PhysDttpSize =
smallmoney
smalldatetime
datetime
timestamp

=
=
=
=

8
4
8
8

Trigger variables and parameters


The parameters for trigger definition and available trigger variables are explained in detail in the
Triggers and Procedures chapter of PowerDesigner User's Guides.

68

Potrebbero piacerti anche