of x

User Guide Toad Data Modeler

Published on June 2016 | Categories: Documents | Downloads: 12 | Comments: 0
471 views

Guia de Usuario de Toda data Modeler 5

Comments

Content

®

Toad Data Modeler 5.0
User Guide

Copyright
© 2013 Quest Software, Inc.
ALL RIGHTS RESERVED.
This guide contains proprietary information protected by copyright. The software described in
this guide is furnished under a software license or nondisclosure agreement. This software may be
used or copied only in accordance with the terms of the applicable agreement. No part of this
guide may be reproduced or transmitted in any form or by any means, electronic or mechanical,
including photocopying and recording for any purpose other than the purchaser’s personal use
without the written permission of Quest Software, Inc.
The information in this document is provided in connection with Quest products. No license,
express or implied, by estoppel or otherwise, to any intellectual property right is granted by this
document or in connection with the sale of Quest products. EXCEPT AS SET FORTH IN
QUEST'S TERMS AND CONDITIONS AS SPECIFIED IN THE LICENSE AGREEMENT FOR
THIS PRODUCT, QUEST ASSUMES NO LIABILITY WHATSOEVER AND DISCLAIMS
ANY EXPRESS, IMPLIED OR STATUTORY WARRANTY RELATING TO ITS PRODUCTS
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTY OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL QUEST BE LIABLE FOR ANY DIRECT,
INDIRECT, CONSEQUENTIAL, PUNITIVE, SPECIAL OR INCIDENTAL DAMAGES
(INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF PROFITS, BUSINESS
INTERRUPTION OR LOSS OF INFORMATION) ARISING OUT OF THE USE OR
INABILITY TO USE THIS DOCUMENT, EVEN IF QUEST HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES. Quest makes no representations or warranties with respect
to the accuracy or completeness of the contents of this document and reserves the right to make
changes to specifications and product descriptions at any time without notice. Quest does not
make any commitment to update the information contained in this document.
If you have any questions regarding your potential use of this material, contact:
Quest Software World Headquarters
LEGAL Dept
5 Polaris Way
Aliso Viejo, CA 92656
email: [email protected]
Refer to our Web site (www.quest.com) for regional and international office information.
Trademarks
Quest, Quest Software, the Quest Software logo, Toad, T.O.A.D., Toad World are trademarks and
registered trademarks of Quest Software, Inc in the United States of America and other countries.
For a complete list of Quest Software’s trademarks, please see
http://www.quest.com/legal/trademark-information.aspx. Other trademarks and registered
trademarks are property of their respective owners.

Table of Contents
Copyright
Introduction to Toad Data Modeler
About Toad Data Modeler

2
17
17

With Toad Data Modeler you can:

17

Benefits

17

Key Features

18

Technical Requirements

18

New Features and Enhancements in Toad Data Modeler 5.0

19

General

19

Newly Supported Database Platforms

23

Connections

26

Reverse Engineering

26

Workspace

27

Database Specific

27

Support for Microsoft Windows 8 PRO

28

Bug Fixes — Release Notes

28

Additional Resources

28

Supported Databases

29

User Interface
Interface Layout

32
32

Toad Data Modeler Application Layout

32

Application View

33

Application Window

38

Designer and Workspace

39

Docking

42

Hot Keys

43

Toad Data Modeler User Guide

4

Table of Contents

Inplace Editor

46

Status of Items in Grids

47

Menus

48

File Menu

48

Edit Menu

49

View Menu

50

Objects Menu

51

Layout Menu

51

Model Menu

52

Tools Menu

53

Macros Menu

53

Expert Mode Menu

55

Settings Menu

55

Window Menu

56

Help Menu

56

Projects and Models
Projects
Create New Project

Models

57
57
57

60

Model Objects

60

Shortcut Right-Click Options in Model Explorer

79

Note Shortcuts

80

Image in Model Explorer

82

Image and Shortcuts

82

Stamp and Shortcuts

83

Caption of Categories and Shortcuts

83

Physical Data Model

84

Entity List

88

Toad Data Modeler User Guide

5

Table of Contents

Buttons:

93

A. Drag&Drop techniques + CTRL on the Workspace

94

B. Copy&Paste functions: Edit | Copy/Paste (CTRL+C, CTRL+V)

94

C. In the Entities dialog: Drag&Drop techniques + CTRL

94

D. In Model Explorer: Drag&Drop techniques + CTRL

95

Other Notes

96

Buttons:

105

Manual Order

111

Automatic Order

112

A. CTRL + Drag&Drop techniques on the Workspace

112

B. In the Entity Properties form | Attributes tab: CTRL + Drag&Drop
techniques

113

C. In Model Explorer

114

Other Notes

114

A. Drag&Drop techniques on the Workspace

114

B. In Entity Properties Form | Attributes tab: Drag&Drop techniques

115

C. In Model Explorer

115

Assign a Key to Attribute

118

NotNull Property for PK and AK Attributes

118

Linking Method

121

Synchronization of NotNull and Mandatory Parent

127

Foreign Keys in the Attribute Properties Dialog

127

Foreign Keys in the Relationship Properties Dialog

128

Automatic FK Mapping

Add Permissions

130

138

Domains

154

User Data Types

154

Toad Data Modeler User Guide

6

Table of Contents

Dictionary Types

154

How to Export/Import Dictionary

154

IE Notation

155

Cardinality

155

IDF1X Notation

157

Cardinality

157

Relationship Types

158

Identifying Relationship

158

Non-identifying Relationship

159

Non-identifying Self-relationship

159

M:N Relationship

160

Identifying Relationship

160

Non-Identifying Relationship

161
161

Self-Relationship for Non-identifying Relationship

162

M:N Relationship

162

Buttons:

168

Straight Mode

171

Right Angled Mode

173

Move Relationship Anchor Points

173

Move Relationship Lines

173

Move, Hide, Find Relationship Names

174

Multiple Selection/Move of Relationships

174

Compare Procedures in Sync & Convert Wizard

190

Default box versus Default Rule combo-box

196

Method A - via the Users dialog

200

Method B - via the User Groups dialog

201

Toad Data Modeler User Guide

7

Table of Contents

Synchronization of NotNull and Mandatory Parent.

213

PFK

219

FK

219

Automatic FK Mapping

220

Universal Data Model

288

Logical Data Model

288

Buttons:

298

a) Single Table - Parent Inherits All Children

313

b) N - 1 - Each Child Inherits the Parent

314

c) N Tables - Physical Model Matches Logical

314

Reports

319

Report Generation

319

Print

329

Graphics

333

Autolayout

333

Align Objects

335

Arrange Objects, Match Size and Space Arrangement

335

Arrange Objects in Layers

336

Arrange Relationship Lines

337

Categories

339

Change Notation

342

Data Warehouse Types

343

Display Modes

346

Display Level for Entities

348

Format Workspaces and Objects

349

Select Colors for Attributes and Keys

350

Show Grid and Grid Size

351

Zoom, Overview, Loupe, Move

351

Toad Data Modeler User Guide

8

Table of Contents

Tools

352

Refactoring Utility

352

Schema/Owner/Database Assignment

353

Naming Conventions

354

Infer Relationships

371

Infer Relationships and Reverse Engineering

373

Features

374

Application Variables

374

Command Line Parameters

379

Categories

381

Find

384

Gallery

386

Message Explorer

389

Model Explorer

391

Model Properties

397

Model Statistics

399

Modeless Dialogs/Forms

399

Object Navigator Box

402

Object Viewer

404

Object Types and Properties - OTPs

406

Quick Search

410

Find

414

Search Items

416

To Do List

418

Undo, Redo Functions

420

Open Toad Data Modeler 2.x Models or CASE Studio 2 files

421

Conversion
Data Type Conversion Settings

422
422

Toad Data Modeler User Guide

9

Table of Contents

PER - PER Conversion Information

425

PER - LER Conversion Information

428

Convert Model

431

Simple Model Conversion

434

Synchronization

435

Synchronization

435

Sync & Convert Wizard

438

Alter Scripts

443

Model Update

451

Model Compare

455

Model Merge

457

Options and Configuration

464

Options

464

Default Values

470

Templates

473

Dictionaries

483

File Extensions

483

Version Control

488

Subversion

488

Version Manager

502

Tips and Tricks

514

Connection Strings for Reverse Engineering

514

Rename

515

Shift and Zoom in Your Model

515

Tips and Hints for Large Models

516

Other Quick Tips

520

Scripting and Customization
About Scripting and Customization

522
522

Toad Data Modeler User Guide

10

Table of Contents

Package Explorer

527

Script Explorer

531

Script Editor

535

Scripting in Script Editor

537

Internal Scripting

539

Scripting Window

541

Sample Scripts and Scripting Tips

543

Customization - Sample

551

Customize Forms and Frames

586

Macros

593

Metamodel

621

Script Samples

631

Automation

639

Toad for Oracle Integration

650

About Integration Options

650

Toad for Oracle Connections

652

Open Toad for Oracle Projects

653

Import Toad for Oracle ER Diagrams

653

Toad for Oracle as Default Editor

656

Toad for Oracle Icons

656

Databases

658

Supported Databases

658

DB2 UDB v. 8 (LUW)

661

Specifics - DB2 UDB v. 8 (LUW)

661

Script Generation - DB2 UDB v. 8 (LUW)

667

Extra Objects - DB2 UDB v. 8 (LUW)

667

DB2 v. 9 (LUW)
Specifics - DB2 v. 9 (LUW)

668
668

Toad Data Modeler User Guide

11

Table of Contents

Script Generation - DB2 v. 9 (LUW)

678

Extra Objects - DB2 v. 9 (LUW)

679

DB2 v. 9.5 (LUW)

681

Specifics - DB2 9.5 (LUW)

681

Script Generation - DB2 9.5 (LUW)

685

Extra Objects - DB2 9.5 (LUW)

685

DB2 v. 9.7 (LUW)

686

Specifics - DB2 9.7 (LUW)

686

Script Generation - DB2 9.7 (LUW)

692

Extra Objects - DB2 9.7 (LUW)

693

DB2 v. 10.1 (LUW)

694

Extra Objects - DB2 10.1 (LUW)

694

Specifics - DB2 10.1 (LUW)

694

DB2 z/OS v. 9

697

Extra Objects - DB2 z/OS v. 9

697

Specifics - DB2 z/OS v. 9

699

Script Generation - DB2 z/OS v. 9

712

DB2z-OS v.10

713

Extra Objects - DB2 z/OS v. 10

713

Script Generation - DB2 z/OS v. 10

713

Specifics - DB2 z/OS v. 10

714

Greenplum 4.1

728

Extra Objects - Greenplum 4.1

728

Reverse Engineering - Greenplum 4.1

734

Specifics - Greenplum 4.1

735

Greenplum 4.2

739

Extra Objects - Greenplum 4.2

739

Specifics - Greenplum 4.2

739

Toad Data Modeler User Guide

12

Table of Contents

Ingres

740

Extra Objects - Ingres 9.3

740

Script Generation - Ingres 9.3

741

Specifics - Ingres 9.3

745

Microsoft Access 2000/2002/2003

746

Script Generation - MS Access 2000/2002/2003

746

Specifics - Microsoft Access 2000/2002/2003

747

Microsoft Access 2007/2010

747

Script Generation - MS Access 2007/2010

747

Specifics - Microsoft Access 2007/2010

751

Microsoft SQL Azure

757

Specifics - Microsoft SQL Azure

757

Script Generation - Microsoft SQL Azure

774

Microsoft SQL Server 2000

775

Specifics - Microsoft SQL Server 2000

775

Script Generation - Microsoft SQL Server 2000

776

Extra Objects - Microsoft SQL Server 2000

777

Microsoft SQL Server 2005

779

Specifics - Microsoft SQL Server 2005

779

Script Generation - Microsoft SQL Server 2005

798

Extra Objects - Microsoft SQL Server 2005

799

Microsoft SQL Server 2008

801

Reverse Engineering - Microsoft SQL Server 2008

801

Specifics - Microsoft SQL Server 2008

806

Script Generation - Microsoft SQL Server 2008

818

Extra Objects - Microsoft SQL Server 2008

819

Microsoft SQL Server 2012
Extra Objects - Microsoft Server SQL 2012

821
821

Toad Data Modeler User Guide

13

Table of Contents

Script Generation - Microsoft SQL Server 2012

821

Specifics - Microsoft SQL Server 2012

824

MySQL 5.0

831

Extra Objects - MySQL 5.0

831

Specifics - MySQL 5.0

832

Script Generation - MySQL 5.0

837

MySQL 5.1

838

Extra Objects - MySQL 5.1

838

Specifics - MySQL 5.1

839

Script Generation - MySQL 5.1

842

MySQL 5.5

843

Extra Objects - MySQL 5.5

843

Reverse Engineering - MySQL 5.5

843

Script Generation - MySQL 5.5

848

Specifics - MySQL 5.5

848

Oracle 9i

848

Extra Objects - Oracle 9i

848

Specifics - Oracle 9i

849

Script Generation - Oracle 9i

849

Oracle 10g

850

Extra Objects - Oracle 10g

850

Reverse Engineering - Oracle 10g

853

Script Generation - Oracle 10g

861

Specifics - Oracle 10g

863

Oracle 11g Release 1

883

Extra Objects - Oracle 11g Release 1

883

Script Generation - Oracle 11g Release 1

884

Specifics - Oracle 11g Release 1

885

Toad Data Modeler User Guide

14

Table of Contents

Oracle 11g Release 2

889

Extra Objects - Oracle 11g Release 2

889

Script Generation - Oracle 11g Release 2

891

Specifics - Oracle 11g Release 2

894

PostgreSQL 8.1

898

Extra Objects - PostgreSQL 8.1

898

Specifics - PostgreSQL 8.1

898

Script Generation - PostgreSQL 8.1

899

PostgreSQL 8.2

899

Extra Objects - PostgreSQL 8.2

899

Specifics - PostgreSQL 8.2

903

Script Generation - PostgreSQL 8.2

914

PostgreSQL 8.3

915

Extra Objects - PostgreSQL 8.3

915

Specifics - PostgreSQL 8.3

917

Script Generation - PostgreSQL 8.3

921

PostgreSQL 8.4

922

Extra Objects - PostgreSQL 8.4

922

Specifics - PostgreSQL 8.4

922

Script Generation - PostgreSQL 8.4

929

Specifics - PosgreSQL 9.0

929

User Data Type

929

Entity

930

Key Properties

931

Trigger

932

Extra Objects - PostgreSQL 9.0

932

Script Generation - PostgreSQL 9.0

933

Specifics - PosgreSQL 9.0

934

Toad Data Modeler User Guide

15

Table of Contents

PostgreSQL 9.1

937

Extra Objects - PostgreSQL 9.1

937

Script Generation - PostgreSQL 9.0

940

Specifics - PostgreSQL 9.1

941

PostgreSQL 9.2

951

Extra Objects - PostgreSQL 9.2

951

Reverse Engineering - PostgreSQL 9.2

951

Script Generation - PostgreSQL 9.2

956

Specifics - PostgreSQL 9.2

956

SQLite 3.7

959

Extra Objects - SQLite 3.7

959

Script Generation - SQLite 3.7

961

Specifics - SQLite 3.7

964

Sybase ASE 12.5

975

Specifics - Sybase ASE 12.5

975

Script Generation - Sybase ASE 12.5

976

Extra Objects - Sybase ASE 12.5

976

Sybase ASE 15

977

Specifics - Sybase ASE 15

977

Script Generation - Sybase ASE 15

990

Extra Objects - Sybase ASE 15

990

Sybase ASE 15.5

990

Extra Objects - Sybase ASE 15.5

990

Script Generation - Sybase ASE 15.5

991

Specifics - Sybase ASE 15.5

992

Sybase ASE 15.7

998

Extra Objects - Sybase ASE 15.7

998

Script Generation - Sybase ASE 15.7

999

Toad Data Modeler User Guide

16

Table of Contents

Specifics - Sybase ASE 15.7

Sybase IQ 15.2

1000

1004

Extra Objects - Sybase IQ 15

1004

Script Generation - Sybase IQ 15.2

1007

Specifics - Sybase IQ 15.2

1009

Sybase SQL Anywhere 11

1020

Extra Objects - Sybase SQL Anywhere 11

1020

Reverse Engineering - Sybase SQL Anywhere 11

1022

Specifics - Sybase SQL Anywhere 11

1029

Script Generation - Sybase SQL Anywhere 11

1042

Teradata 13

1044

Extra Objects - Teradata 13

1044

Script Generation - Teradata 13

1045

Specifics - Teradata 13

1049

Supported Data Types

1059

Appendix: Contact Quest

1060

Contact Quest Support

1060

Contact Quest Software

1060

About Quest Software

1060

Visit Modeling Community

1061

Submit Your Ideas and Suggestions

Index

1061

1062

1
Introduction to Toad Data Modeler
About Toad Data Modeler
Toad Data Modeler helps organizations create, maintain and document their database systems
with an easy-to-use graphical interface into new or existing database structures.

With Toad Data Modeler you can:
l

Create database structures visually (Logical, Universal and Physical Entity Relationship
Diagrams - ERD).

l

Create ERD for various target database systems (Oracle Database, Microsoft SQL Server,
DB2, MySQL, PostgreSQL etc., see Supported Databases (page 658)).

l

Reverse engineer already existing database structures and see the existing database
structure in a form of a diagram.

l

Add logical data to your diagrams and describe existing database structures better.

l

Verify model, get a list of Errors, Warnings and Hints and use Quick Fixes to
correct issues.

l

Automatically generate SQL code for selected target database.

l

Generate detailed documentation in HTML, RTF or PDF format.

l

Synchronize a model with physically existing database (using Alter Script Generation and
Model Merge features) and much more.

Benefits
Toad Data Modeler allows you to:
l

Reduce faults in development

l

Significantly improve your productivity

l

Visualize your database structures and get better understanding of your existing databases

l

Verify your work automatically

l

Generate very detailed HTML, RTF or PDF reports

l

Work with existing database structures

l

Keep existing database structures up-to-date

Toad Data Modeler User Guide

18

Introduction to Toad Data Modeler

Key Features
l

Physical Model, Universal Model (Generic Relational Model) and Logical Model

l

Support for Various Databases

l

Reverse Engineering

l

Version Control System (support for Apache Subversion) and Internal Version Manager

l

Projects for storing models and additional documentation

l

SQL/DDL Script Generation

l

HTML/RTF Reports (including Alter reports)

l

Model Merge, Model Compare,

l

Model Verification

l

Autolayout

l

Refactoring Utility

l

Automation

l

Templates, Gallery, Default Values, Application Variables, Macros

l

Undo/Redo

l

To-Do List

l

Zoom, Loupe, Model Overview features and many more...

Technical Requirements
Minimal

Optimal

Platform

Pentium

Pentium dual core

Memory

512 MB

4 GB

Hard Disk Space

200 MB

400 MB

Operating System

Microsoft Windows XP (32/64-bit, Service Pack 2)
Microsoft Windows Vista (32/64-bit)
Microsoft Windows Server 2003 (32/64-bit, Service Pack 2)
Microsoft Windows Server 2008 (32/64-bit)
Microsoft Windows Server 2008 R2 (64-bit)
Microsoft Windows 7 (32/64-bit)
Microsoft Windows 8 PRO (64-bit)

Toad Data Modeler User Guide

19

Introduction to Toad Data Modeler

Toad Data Modeler delivers increased level of efficiency, quality and
comfort to all database professionals.

New Features and Enhancements in Toad Data
Modeler 5.0
l

l

General improvements
o

User Interface

o

Performance

Newly Supported database platforms
o

PostgreSQL 9.2

o

Greenplum 4.1 and 4.2

o

IBM DB2 10.1 (LUW)

l

Connections

l

Reverse Engineering

l

Workspace

l

Database Specific

l

o

Oracle 11g R2

o

Microsoft SQL Server - Windows Authentication

Support for Microsoft Windows 8

General
User Interface Improvements
Main Menu
Main Menu has been considerably reviewed in order to provide users with the most logical and
comfortable management and workflow.
Toolbars
All Toolbars have been reviewed and new items have been added.

Layout Menu:

Toad Data Modeler User Guide
Introduction to Toad Data Modeler

l

Autolayout – Top to Down

l

Autolayout – Left to Right (New)

l

Alphabetic/Square Autolayout (New)

l

Right Angled Mode

l

Hide Captions

Autolayout can be applied to only a part/selection of objects on the workspace.
New Forms
Entity Properties, Attribute Properties and Relationship Properties forms were simplified to
minimize necessary mouse-clicks.

Designer

20

Toad Data Modeler User Guide
Introduction to Toad Data Modeler

New pop-up menu Add - allows adding attributes, keys, indexes, unique identifiers (options
available are based on model type - LER/PER)

Working with attributes on the Designer
l

CTRL+Click - selects the attribute

l

CTRL+Double Click - opens Attribute/Index form

l

F2 – opens inplace editor of the entity name

On a selected attribute
l

Click - nothing

l

Long Click - opens inplace editor

l

Double Click - opens attribute form

l

CTRL+Click - unselects the attribute

l

F2 – opens inplace editor of the attribute (single attribute must be selected)

Working in Edit forms in the Grid

21

Toad Data Modeler User Guide
Introduction to Toad Data Modeler

Using keypads
l

Insert – inserts a new record for the focused

l

Delete – deletes the focused record

l

F2 - Multiline inplace editor for Comments

Foreign Keys
Foreign Keys can be deleted directly in the Attributes pane of the Entity Properties form.
New function Infer Relationships available in Tools menu.

Data Warehouse Type
New Data Warehouse options available in Physical Model.

22

Toad Data Modeler User Guide

23

Introduction to Toad Data Modeler

Performance
Improvements made in performance of Toad Data Modeler. This is connected with several
other new implementations and fixes mentioned further bellow (e.g. several improvements were
implemented in convertor).
Further, performance when starting Toad Data Modeler and when opening/processing data
models has been improved. Option to save models in binary file format TBP was added —
recommended for larger models (several hundreds or thousands of attributes, entities...).

Newly Supported Database Platforms
Support for PostgreSQL 9.2
Supported features

Toad Data Modeler User Guide

24

Introduction to Toad Data Modeler

l

reverse engineering

l

alter script generation

l

SQL/DDL script generation

l

reports

Foreign Table Attributes
l

Options can be specified

Functions
l

Leakproof option available

Indexes
l

Index Access Method have new option spgist

l

Buffering parameter option available for gist index

Table, Attribute - Check Constraint
l

No Inherit option to allow not inherited constraints

Support for Greenplum 4.1 and 4.2
Greenplum is based on PostgreSQL 8.2, therefore functionality and features available are similar.
Permissions can be set for entities, views and functions.
Foreign Key (referential integrity) - Foreign key constraints are not supported in Greenplum
Database. Can be created, but are not enforced.
Trigger - Triggers can be created, but functionality is limited considerably!
Supported features
l

reverse engineering

l

alter script generation

l

SQL/DDL script generation

l

reports

Extra Objects of Greenplum database supported in Toad Data Modeler
Most extra objects are based on PostgreSQL 8.2 database.
l

Aggregate

l

Sequences

l

Rewrite Rules

l

External Tables (specific for Greenplum db)

Toad Data Modeler User Guide
Introduction to Toad Data Modeler

Objects not supported in Toad Data Modeler
l

Resource Queue

l

(Trusted) Protocol

l

Filespace

Note: Creation of some objects is not supported, e.g. Tablespace.
Specifics of Greenplum 4.1
l

Entity - Storage Parameters, Table Partitions/Subpartitions defined textually

l

Attributes - Array Type pane - Is Array Type checkbox | Array Dimension

l

Dictionary Type/Domain

Specifics of Greenplum 4.2
l

Entity
o

New options available for Storage Parameters and Compress Type

l

Attribute

l

External Table

l

User Data type

l

Function

Support for IBM DB2 10.1 (LUW)
Supported features - reverse engineering, alter script generation, SQL/DDL script
generation, reports.
Specifics
l

l

Entities
o

Organize by Insert Time option added

o

Compression Mode option added with values ADAPTIVE/STATIC

o

Period Definition (BUSINESS_TIME/SYSTEM_TIME values) option added

Attributes
o

New data types - nchar, nvarchar, nclob

o

New pane Generated replaced former Identity/Identity and Row Change
Timestamp.

l

Functions - Secured checkbox on Function Parameters pane added for function types
External Scalar, External Table, OLE DB, SQL

l

Indexes - Business Time Without Overlaps option added on General pane

25

Toad Data Modeler User Guide

26

Introduction to Toad Data Modeler

l

Unique Constraints - Business Time Without Overlaps option added

l

Trigger - Trigger event allows OR option, set for generating SQL script in Extended
Value, option Create or Replace

l

Type - Array Type allows BOOLEAN data type

Connections
Connections dialog was considerably redesigned to provide easy way to manage your database
connections.

Reverse Engineering
Changes were made in RE Wizard to simplify workflow (Stored Connections pane, Select Data
Migrator pane removed, Options pane).
Option Infer Relationships added.

Toad Data Modeler User Guide

27

Introduction to Toad Data Modeler

Workspace
New Workspace Properties dialog - Workspace Properties Edit dialog merged with Members
dialog (Add Selected Objects to Workspace…) to provide easier, logical management of objects
in the workspace. Both the already added objects (selected checkbox in the left-most column) as
well as the other model objects are displayed on the Members pane of the dialog. Objects can be
easily filtered using advanced filtering/search methods.

Database Specific
Oracle 11g R2
View Trigger in Oracle 11g R2 has been updated with missing features.
l

Column List

l

For Each Row

l

When Condition

The new options are enabled based on the type of the trigger (Trigger Fire option selected).
Microsoft SQL Server
Support for Windows Authentication added for Native database connection.

Toad Data Modeler User Guide
Introduction to Toad Data Modeler

Support for Microsoft Windows 8 PRO
Support for Microsoft Windows 8 PRO 64-bit operating system is officially introduced.

Bug Fixes — Release Notes
See Resolved Issues and Enhancements section of Toad Data Modeler 5.0 Release Notes at
http://www.quest.com/toad-data-modeler/

Related topics:
Options
Supported Databases
Script Generation

Additional Resources
For additional resources about Toad Data Modeler, click the following links to view the:

28

Toad Data Modeler User Guide

29

Introduction to Toad Data Modeler

l

Instructional Flash Movies

l

Tips and Tricks

l

Sample models

l

Sample scripts

l

User packages

l

XSL templates

l

Localized Report Dictionaries

Supported Databases

Supported Database
System

DB2 z/OS v. 10
DB2 z/OS v. 9
DB2 v. 10.1 (LUW)
DB2 v. 9.7 (LUW)
DB2 v. 9.5 (LUW)
DB2 v. 9 (LUW)
DB2 UDB v. 8
(LUW)
Greenplum 4.1
Greenplum 4.2
Ingres 10.0
Ingres 9.3
Microsoft Access
2007/2010
Microsoft Access

Reverse
Engineering

Import
From SQL
File

Alter Script
Generation

SQL/DDL
Code
Generation

Toad Data Modeler User Guide

30

Introduction to Toad Data Modeler

Supported Database
System

2000-2003
Microsoft SQL Azure
Microsoft SQL
Server 2012
Microsoft SQL
Server 2008
Microsoft SQL
Server 2005
Microsoft SQL
Server 2000
MySQL 5.5
MySQL 5.1
MySQL 5.0
Oracle 11g R2
Oracle 11g R1
Oracle 10g
Oracle 9i
PostgreSQL 9.2
PostgreSQL 9.1
PostgreSQL 9.0
PostgreSQL 8.4
PostgreSQL 8.3
PostgreSQL 8.2
PostgreSQL 8.1

Reverse
Engineering

Import
From SQL
File

Alter Script
Generation

SQL/DDL
Code
Generation

Toad Data Modeler User Guide

31

Introduction to Toad Data Modeler

Supported Database
System

Reverse
Engineering

Import
From SQL
File

Alter Script
Generation

SQL/DDL
Code
Generation

SQLite 3.7
Sybase ASE 15.7
Sybase ASE 15.5
Sybase ASE 15
Sybase ASE 12.5
Sybase IQ 15.2
Sybase SQL
Anywhere 11
Teradata 13
Other databases
(Universal Model)

Learn details (reverse engineering, specifics, script generation etc.) about your particular database
version in chapter "Databases".
Support for latest versions of other database systems will be added to the product gradually.
Note: Toad Data Modeler includes also support of Universal DB/ANSI Models. See "Universal
DB/ANSI Model" (page 262) for more information.

Toad Data Modeler User Guide

32

User Interface

User Interface
Interface Layout
Toad Data Modeler Application Layout
Simple and Minimalist Layout
Layout of Toad Data Modelercan be both simple and complex. Various panes can be docked on
left side, right side or at bottom of the application and some of the areas can be collapsed using
tiny buttons in the middle of window splitters. The default layout for basic operations and tasks
can be similar to this:

Toad Data Modeler User Guide

33

User Interface

Expanded Area

Application View
All currently opened models and their Workspaces are listed in the Application View (AV). In
the AV you can:
l

Manage your models (activate model, save, close etc.)

l

Edit model names (F2 or Rename)

l

Work with Workspaces and Designers

Application View is by default docked on the bottom left side, next to the Message Explorer.
You can close it at any time (x) and open later.
To open the Application View
»

Click

on the toolbar (or select Windows | Application View).

Toad Data Modeler User Guide

34

User Interface

Tips:
l

You can open several instances of the Application View, e.g. for each model and see their
Workspaces clearly.

l

Feel free to dock Application View in other places.

l

To hide/show the Application View, click the splitter in the middle of the pane.

l

When you need to find a particular model or Workspace in the Application View, simply
expand the tree items and start typing the model/Workspace name. It will be found at
once. - This function works for expanded folders (search will not go through folders that
are collapsed).

Note: In the Application View, also versions and revisions checked out from Version Manager
are listed.

Application View Right-Click Options
Right-click the Model to see the following options:
Option

Description

Activate
Model

It highlights the selected model and enables menu +
toolbar options for this model.

Add
Workspace

Adds a new workspace (WS) in the model. New WS
opens in the Application Window. The Workspace
Properties dialog automatically displays. In this dialog,

Toad Data Modeler User Guide
User Interface

Option

Description
you can define the name of the WS and description. To
disable this function, select Settings | Options | General
and clear the Open Workspace Properties Dialog after
Add Workspace checkbox.

Model
Properties

Opens the Model Properties dialog.

Save

Saves the model.

Save as

Allows you to save the selected model to another file.

Object
Viewer

Allows you to display a complete list of objects, e.g.
attributes, triggers, check constraints, views, etc. with a
possibility to open the Properties dialog of the selected
object.
See "Object Viewer" (page 404) for more information.

Sync &
Convert
Wizard

Opens the Sync & Convert Wizard.

Rename

Renames the model.

Close
Model

Closes the selected model. If any changes have been
made in the model, confirmation dialog opens.
Note: If you select Do not show next time, your model
will be always saved before the application closes
without asking for this confirmation.
To display this confirmation again, select Settings |
Options | Application section | Dialog Boxes and clear
the Save Model option.

In Expert Mode, the following options are available:
See Expert Mode for more information.
Add to
Version
Manager

Allows you to add the model to Version Manager.

Test Model

Runs internal test of model consistency.

Repair
Model

Can fix 60 % of problems found during the Test Model.
Note: Verify Model versus Test Model:
Verify Model checks out your model from the modeling

35

Toad Data Modeler User Guide
User Interface

Option

Description
point of view. If your model is correct, and regardless
some problems occur, Test Model can be run. Returned
messages will be displayed in the Message Explorer
where you can save them to LocalLog.txt file and send to
us. They will help our developers to determine where
particular problem is.
If any problem is found during Test Model, you can also
run Repair Model. 60 % of problems can be solved this
way.
See "VerificationModel VerificationToad Data Modeler
allows you to verify your models. You can select what
items of your model you want to check, find out what
errors and flaws your model contains etc. To verify your
modelSelect Model | Verify Model... (also CTRL+F9).On
tab Model Objects, select Object Types and instances of
objects that you want to verify. On tab Verification
Settings, select options for verification. To save the
settings, click Save & Verify. To see the process of
verification and final result, activate the Verification Log
The log should be activated automatically. To activate
the log manually, click Tools | Verification Log. Model
Verification FormOn tab Model Objects, you can see
object types as well as instances of objects that exist in
your model.On tab Verification Settings, you can enable
or disable errors, warning and hints. Additional
information is available on right side.Rules are database
dependent, the following screenshot shows rules for
Microsoft SQL Server 2012. Verification Log & Model
ExplorerResults are displayed in Verification Log at
bottom. Errors, warnings and hints are displayed in
Physical Model Explorer in form of small graphics placed
to right top corner of each object icon. Verification Log
ToolbarVerification toolbar icons:Tree or Grid
layoutShow ErrorsShow WarningsShow HintsShow
Model Verification Form (Allows you to specify settings)
Quick Model Verification (Executes model verification)
 Quick FixesToad Data Modeleroffers Quick Fixes,
recommended solutions for selected problems or issues.
Quick Fixes are accessible in both Verification Log
andPhysical Model Explorer. In Verification Log you can
switch between Tree and Grid layouts, using the first icon
on Verification Log toolbar.Tree layout shows Quick
Fixes as hyperlinks, Grid layout allows you to apply

36

Toad Data Modeler User Guide
User Interface

Option

Description
Quick Fixes via popup menu.Right click an item in Grid
layout to see available Quick Fixes.On Form
VerificationErrors, warning and hints can be displayed
directly on object form, at bottom. Quick Fixes are not
available in this mode. SettingsVerification rules can be
specified as Errors, Warnings and Hints and you can
modify the categorization in Settings. Navigate to
selected target database and define settings for Model
Verification. " (page 1) for more information..

Right-click the Workspaces to see the following options:
Option

Description

Add
Workspace

Creates a new workspace (WS) in the model.

Open All
Designers

Opens Designers of all existing Workspaces in the
Application Window.

Right-click the name of particular Workspace to see the following options:
Option

Description

Activate
Designer

Activates already opened Designer of the selected
WS, or opens Designer for this WS in the
Application Window.

Open Designer

Opens another Designer for the selected WS.

Edit

Opens the Workspace Properties dialog where you
can define the name of the WS and description.

Workspace
Format

Opens the Workspace Format dialog.

Add All Model
Objects to
Workspace

Adds shortcuts of all objects of the model to the
selected WS.

Add Selected
Objects to
Workspace

Opens a dialog where you can select shortcuts of
objects that you want to add to the WS.

Rename

Renames the Workspace name.

37

Toad Data Modeler User Guide

38

User Interface

Option

Description

Delete
Workspace

Deletes the selected WS from model.

Note: All these right-click options are identical with those for model and Workspaces in
Model Explorer.

Application Window
Application Window (AW) represents a work area where you design your models, work with
scripts etc.
Toad Data Modeler 3.x allows you to work with several models of the same or different
databases simultaneously. The models and their Workspaces and Designers are organized in the
Application Window on tabs by models. Also, the Script Editor and Scripting Window open on
appropriate tabs in the Application Window. It is possible to dock Model Explorer of a
particular model on the Application Window too.

Right-click a tab in the Application Window to see the following options:
l

Rename

l

Model Properties

l

Workspace Properties

l

Move Tab Left

l

Move Tab Right

Toad Data Modeler User Guide

39

User Interface

l

Close Other Tabs

l

Close

To close all model Workspaces and Designers at one jump
»

Click x (upper x) in the right-hand corner of the model tab in AW.

To close a tab with particular Designer
»

Click x (lower x) or select File | Close Designer.

To display a Designer for a Workspace
»

Select a Workspace in the Application View or Model Explorer |right-click and select
Activate Designer.

To open another Designer for particular Workspace
»

Right-click the selected WS in Model Explorer (or Application View) and select
Open Designer.

Tips:
l

If you create a new Workspace, its Designer will open automatically in the
Application Window.

l

You can move tabs on the Application Window easily: Press CTRL, select a tab
and drag it.

Related Topics
Designer and Workspace (page 39)

Designer and Workspace
l

Designer is an area where the Workspace (WS) is displayed.

l

One Designer represents one WS.

l

A model can have several Workspaces. Workspaces are similar to submodels. They allow
you to display different/same objects of your model. The first WS is called All Items and
is meant as main model.

l

For one WS, you can open several Designers. Designers opened for the same Workspace
display the same objects. This allows you to view different/same parts of the same WS,
and e.g. in a different zoom.

l

You can undock designers or dock them to a particular model in the Application
Window. See "Docking" (page 42) for more information

To create a new Workspace (WS) in your model
»

Press CTRL+W.

Toad Data Modeler User Guide

40

User Interface

The Workspace Properties dialog opens automatically. In this dialog, you can define the name
of the WS and description.
Tip: To disable this function, select Settings | Options | General and clear the Open Workspace
Properties Dialog after Add Workspace checkbox.
To open another Designer for particular Workspace
»

Right-click the selected WS in Model Explorer (or Application View) and select
Open Designer.

To close a tab with particular Designer
»

Click x (lower x) or select File | Close Designer.

Confirmation dialog opens. This message should draw your attention to the fact that although
you closed last Designer of your model from the Application Window, model itself is still open
in Toad Data Modeler (the model is listed in the Application View). This message should
prevent you from the situation when you open the same model again and rewrite the changes
made in first instance of the model.
Select Yes to close your model. If you have made any changes in your model, you will be asked
to save them before the model is closed.

Navigation on Workspace
l

CTRL + scroll mouse to zoom in/zoom out 

l

CTRL +, CTRL + Page Up to zoom in

l

CTRL-, CTRL+ Page Down to zoom out

l

Scroll mouse to move up/down on the Workspace

l

SHIFT + scroll mouse to move to the right/left on the Workspace

l

Holding down the middle button to move on entire page/Workspace

l

Page Down, CTRL + down to move to next page

l

Page Up, CTRL + up to move to previous page

l

CTRL + left to move to the left page

l

CTRL + right to move to the right page

l

Click

l

Press F11 to display the application in full screen mode.

to fit your entire ERD to screen.

Tips:
l

F2 to rename the selected entity on the Workspace.

l

Enter to open Properties dialog of the selected object(s) on the Workspace.

l

CTRL+F4 to close currently active Workspace.

Toad Data Modeler User Guide
User Interface

l

Possibility to move shapes on Workspaces using the keyboard arrows.

l

Possibility to resize shapes of objects in Workspace: SHIFT + keyboard arrows.

l

See "Move Objects" (page 69) for more information.

Workspace Right-Click Options
Right-click the work area in the Application Window to see the following options:
Option

Description

Edit

Opens the Workspace Properties dialog.

Workspace
Format

Opens the Workspace Format dialog. See "Format
Objects" (page 62) for more information.

Add All Model
Objects to
Workspace

Adds shortcuts of all objects of the model to the
selected WS.

Add Selected
Objects to
Workspace

Opens a dialog where you can select shortcuts of
objects that you want to add to the WS. See
"Shortcuts of Objects" (page 72) for more
information.

Straight All Lines

Straights all relationship lines in ERD on particular
Workspace. (This option is disabled in the Right
Angled mode.)

Change Lines to
Right Angled

Changes all relationship lines in ERD on particular
Workspace from straight to right-angled.
See "Straight Mode" (page 171) for more
information.

Select Objects

Selects objects by category or schema/owner on
Workspace.
Define a category or owner or category and owner
and click Select.

Graphic Options on the Workspace
Select Settings | Options | Graphics to access the Settings.

41

Toad Data Modeler User Guide

42

User Interface

Docking
Docking means tacking a form/pane on another form/pane. This feature allows you to customize
the Toad Data Modeler interface to meet your needs and requirements.
The following types of dockable forms are available in Toad Data Modeler:
l

Big dockable forms (Designer, Script Editor etc.)

l

Small dockable forms (Message Explorer, Application View etc.)

You can dock forms/panes:
l

One on another (You can dock only small forms on big ones or big forms on big ones.)

l

One by another

l

One below another

l

On tabs

l

On the Application Window

l

Combination of these options

Model Explorer refers to a particular model, therefore it can be docked only to the model in
the Application Window. It cannot be docked e.g. next to the Message Explorer.

To set settings for docking
1. Click Settings | Options
2. In section General set option Use SHIFT to Dock Forms.

Toad Data Modeler User Guide

43

User Interface

To dock a form/pane
1. Drag, move and drop pane where necessary.

Hot Keys
Shortcut

Description

CTRL+N

Opens the New Model dialog.

CTRL+O

Opens already existing model.

CTRL+S

Saves a model.

CTRL+W

Creates a new Workspace (WS).

CTRL+F9

Opens the Model Verification dialog.

Toad Data Modeler User Guide

44

User Interface

Shortcut

Description

CTRL+E

Creates a new entity.

CTRL+R

Creates an identifying relationship.

CTRL+C

Copies selected object(s).

CTRL+X

Cuts selected objects(s).

CTRL+V

Pastes copied or cut object(s).

CTRL+Z

Undo step.

SHIFT+CTRL+Z

Redo step.

CTRL+A

Selects all.

CTRL+F

Opens the Find dialog.

CTRL+ALT+F

Opens the Find in Scripts dialog.

CTRL+M

Minimizes all undocked forms.

Del

Removes selected object(s) from
Workspace.

SHIFT+Del

Deletes selected object(s) from model.

ALT+O

The Delete Confirmation dialog - OK
button.

ALT+C

The Delete Confirmation dialog - Cancel
button.

CTRL+M

Minimizes Forms.

CTRL+ALT+S

Synchronizes metamodel.

CTRL+I

Creates Inheritance (Logical Model).

F1

Opens the Help file.

F2

Renames model/object.

F9

Opens the DDL Script Generation dialog.

F11

Displays Toad Data Modeler in full screen
mode.

CTRL+Up

Moves selected object(s) up. (Order of

Toad Data Modeler User Guide

45

User Interface

Shortcut

Description
Generated Objects)

CTRL+Down

Moves selected object(s) down. (Order of
Generated Objects)

Keyboard arrows

Moves shapes in Workspace (select a
shape first).

SHIFT+keyboard arrows

Changes size of entity box.

CTRL+scroll mouse

Zooms in/out.

CTRL+, CTRL+Page Up

Zooms in.

CTRL-, CTRL+Page
Down

Zooms out.

SHIFT+scroll mouse

Moves to the right/left on the Workspace.

Scroll mouse

Moves up/down on the Workspace.

Holding down the middle
mouse button

Moves in entire page/Workspace.

Page Down, CTRL +
down

Moves to next page.

Page Up, CTRL + up

Moves to previous page.

CTRL + left

Moves to the left page.

CTRL + right

Moves to the right page.

SHIFT + drag&drop the
heading of a form/pane

Docks the selected form/pane on a
particular place in the Application
Window.

SHIFT + double-click the
heading of a form/pane

Undocks the selected form/pane.

SHIFT

Multiple selection of objects (on the WS,
dialogs, forms, Model Explorer etc.)

Drag&Drop
techniques+CTRL+SHIFT

Creates a shortcut of object on the WS.

Drag&Drop techniques
from Model Explorer

Creates a shortcut of object on the WS.

Toad Data Modeler User Guide

46

User Interface

Shortcut

Description

Drag&drop
techniques+CTRL

Copies objects on the WS/Object dialog
(e.g. Entities dialog)/Model Explorer.

CTRL+Drag&Drop
techniques

Copies attributes between entities in WS.

CTRL+click an attribute

Selects an attribute to move it to another
entity box on the WS. (Click the attribute
and release CTRL key to move the
selected attribute.)

CTRL+click attributes

Multiple selection of attributes in entity
box on the WS.

CTRL+double-click an
object name

Renames the object name on the WS
(including attributes).

CTRL+click a
relationship line

Adds a handle point.

CTRL+click a handle
point

Deletes the selected handle point.

ALT+click a relationship
line

Selects a relationship line segment.

Inplace Editor
Toad Data Modeler allows you to edit items directly in appropriate place (Workspace, frame).
See the following examples.
To change an entity name on the Workspace
1. Click an entity on the Workspace.
2. Press CTRL and double-click the entity name.

3. Change the name and then click the work area.
Note: This way, you can change names of entities, attributes, indexes,

Toad Data Modeler User Guide

47

User Interface

relationships, views, categories, stamp items etc. directly on the WS.

To edit attribute properties directly in an entity frame:
1. Open the Entity Properties form.
2. Select the item that you want to edit and press F2 (or click the item that you want to
change, wait a second and click it again).
3. Change the value and click somewhere in the grid.
4. Confirm Apply.

Related Topics
Modeless Dialogs

Status of Items in Grids
Various types of status are shown on the following examples of attributes and entities.
1. Normal state

2. Attribute Customer ID is being edited. - The item is greyed.

3. A new attribute has just been added, the change has not been confirmed yet.
(After the change is confirmed, the status will change and set to Normal. Until
creation of the new item is confirmed, it's not possible to edit it.)

Toad Data Modeler User Guide

48

User Interface

4. The attribute has been modified in the grid directly (see the changed name). The
change has not been confirmed yet.

5. Item NewAttribute has just been deleted, the change has not been confirmed yet.

6. Deletion of item NewAttribute has been confirmed by clicking the Apply button.
The item is marked as deleted and will not be displayed when you open the
Entity Properties form/Attributes tab next time.

7. You've opened two instances of the same Entity Properties form. You're editing content
in one of them. One Entity Form is disabled and has status n/a. The other, which is being
edited, is active and marked by E.
Note: By default, you can open only one instance of form. To open more instances, select
Settings | Options | General | clear the Allow One Instance of Form checkbox.

Menus
File Menu
The following options are displayed provided that Designer is active in the Application
Window.

Toad Data Modeler User Guide

49

User Interface

Reverse Engineering | Connections opens Connection form where you can manage connections
to your existing databases.
Synchronization | Sync & Convert Wizard... item opens wizard for Model Conversion
and Synchronization tasks.

Related Topics
File Extensions (page 483)

Edit Menu

Toad Data Modeler User Guide

50

User Interface

The Edit menu contains basic actions. Undo and Redo functionality can be accessed from this
menu. In physical model selection of Parent or Child objects can be done by clicking particular
item in the menu.
For object search the standard and well known shortcut CTRL+F can be used. The same feature
can be accessed from the Edit menu as well.

View Menu

Change display mode, display level or notation in View menu.

Toad Data Modeler User Guide

51

User Interface

Objects Menu
The Objects menu is model dependent. Different items appear in Physical Model or
Logical Model.

Object Viewer (page 404)
Caption of Categories and Shortcuts (page 83)
Note Shortcuts (page 80)
Stamp and Shortcuts (page 83)
Image in Model Explorer (page 82)
Model Independent Graphics (page 79)
Objects in Logical Model (page 292)

Layout Menu
Automatic rearrangement of objects in your diagram can be executed from the Layout menu. If
captions of relationships should be hidden, click Layout | Relationship Captions | Hide.

Toad Data Modeler User Guide
User Interface

Model Menu
The options in the Model menu are model dependent.

52

Toad Data Modeler User Guide

53

User Interface

From the Model menu key features can be accessed. Verify model, generate SQL script, generate
Report, Synchronize model etc.

Related Topics
About Physical Data Modeling
About Logical Data Modeling

Tools Menu
The Tools menu contains items for Physical Model only.

Refactoring Utility - if you rename object in your model, the Refactoring Utility can be used for
changing the old object name in SQL properties in other objects. Example: rename attribute and
use the Refactoring Utility to replace the old name with new name in SQL of database views,
triggers, stored procedures etc.
Schema/Owner Assignment... - allows you to assign schema to multiple objects at once.
Naming Conventions - allows you to manage rules and naming standards for objects in
your model.
Infer Relationships - tries to guess and add "missing" relationships to your model.

Macros Menu
The Macros menu contains items that can be customized by users or new features
developed by users.

Toad Data Modeler User Guide
User Interface

Option

Description

All

Displays sample macros that you can use for your
currently active model.
The selected macro will be applied on all objects on all
Workspaces of the model.
Sample macros:

Selected
Objects

l

Convert Names to Lower Case

l

Convert Names to Upper Case

l

Infer Relationship—Macro for automatic creation
of relationships between identically named
columns.

l

Alphabetic Autolayout—See "Autolayout" (page
333) for more information.

Displays sample macros that you can use for your
currently active model.
The selected macro will be applied only on the selected
objects on the currently active Workspace.
Sample macros:

Productivity

l

Remove Spaces from Names

l

Display Entities Note on Workspace

l

Infer Relationship on Selected Entities—Macro
for automatic creation of relationships between
identically named columns.

Displays macros which help you to keep your
productivity at high level.

l

Add Entities—this macro allows you to add
multiple entities in your model at the time

l

Add Attribute to Selected or All Entities—fast

54

Toad Data Modeler User Guide

55

User Interface

Option

Description
and easy way to add new attributes to entities
To see a How to video for this macro, visit our
Community website.

Rename

Displays macros with objects renaming function.

Related Topics
Macros

Expert Mode Menu
The Expert Mode menu appears only if you enable Expert Mode in Options | Settings in section
General. Otherwise the menu item is hidden.

Settings Menu
Via Settings menu the general options can be open.

Toad Data Modeler User Guide

56

User Interface

Window Menu
Window Menu contains basic access point for opening dockable windows or panes and toolbars.

Help Menu
Through the Help menu you can access web site, documentation, community page on
ToadWorld.com and manage Licenses for Toad Data Modeler

Toad Data Modeler User Guide
Projects and Models

Projects and Models
Projects
Create New Project
You can group multiple models, files with requirements and other items to form a project.
To create a new project
»

Click File | New | Project

You can create Toad Data Modeler projects or Empty projects.
Toad Data Modeler projects have predefined structure.

Projects without Version Control System
If you do not plan to use Subversion, choose either Toad Data Modeler Project or Empty
Project item on New Project dialog.

57

Toad Data Modeler User Guide

58

Projects and Models

Specify name for your project and define the path to the folder where your models and other files
will be stored.
Click Create and see the new item in your Application View pane.
Projects with Version Control System
If you wish to keep track of your models and other files in Subversion and use this Version
Control System in Toad Data Modeler, create new project with Version Control System support
(first or second item).

Specify project name and project location

Define Version Control System settings

Toad Data Modeler User Guide

59

Projects and Models

Specify Subversion settings

Click Create to finish the creation of your new project with Version Control System support.
Now you can see your project in Application View and the first operation you should do it to
right click the item and choose Subversion | Check Out (considering project structure was
configured in Subversion first).

More information about Subversion can be found in section Version Control | Subversion.

Toad Data Modeler User Guide

60

Projects and Models

Related topics:
Getting Started with Subversion

Models
Model Objects
Add Objects
Toad Data Modeler allows you to add objects from multiple places. See the following options.
To add an object on Workspace
1. Click an object icon on the toolbar, e.g.

for entity.

2. Click anywhere on the work area to add the object.
Tip: Use hot keys, e.g. CTRL+E for entity, CTRL+I for inheritance, or select the object from the
Objects menu.

To add multiple objects on Workspace
1. Press SHIFT and click the object icon. A blue frame will appear in the icon (for an entity
e.g.

).

2. Click the work area as many times as many objects you need to add.
3. Right-click the work area (or click the object icon again) to turn this function off.
Tip: Use this function to add any object on the toolbar (view, note etc.).
To add objects in Model Explorer
»

Find the object type name in the tree (e.g. Entities) | right-click and select Add (Add
Entity).

To add objects from Model menu
1. Select Model | Model Items | the object type (e.g. Entities).
2. In the dialog (Entities), click Add.

Toad Data Modeler User Guide

61

Projects and Models

Related Topics
Hot Keys (page 43)
Model Explorer (page 391)
Edit Objects
Toad Data Modeler allows you to edit objects from multiple places. See the following options.
To edit objects on the Workspace
»

Double-click or Enter the selected object.
Note: Right-click the selected object(s) to display a pop-up menu.

To edit objects from Model Explorer
»

Find the object in the tree and double-click it (or right-click).

Note: Right-click the object | Edit is also possible. Double-click in Model Explorer does not
highlight the object on the Workspace (WS)but opens the Object Properties dialog. To highlight
the object on WS, you need to expand the Shortcuts folder and double-click the object shortcut.
To edit objects from Objects menu
1. Select object on workspace or in Model Explorer.
2. Select Objects | Edit...
To edit objects from Model menu
1. Select Model | Model Items | the object type (e.g. Entities).
2. In the dialog (Entities), select the object and click Edit.

Buttons in Object Properties dialogs:
- opens the Application Variables form
OK - confirms changes, the form/dialog will close
Cancel - cancels changes
Apply- confirms changes (The changes will be saved and the form/dialog remains opened for
other edit.)
Help - Help navigation

Toad Data Modeler User Guide

62

Projects and Models

Note: Objects of your model that have the Generate checkbox disabled in their Properties
dialogs are displayed in Model Explorer this way:

Related Topics
Model Explorer (page 391)
Shortcuts of Objects (page 72)
Features (page 374)
Default Values (page 470)
Format Objects
l

Object Format for New Models

l

Object Format for Existing Models

l

Object Format for a Particular Object

To set up format for new models (models that you will create)
1. Select Settings | Options | Model section | Physical/Logical Model.
2. Define options on tabs Workspace, Shape and Entity.
3. Press CTRL+N to create a new model.
The format will be used for new models/new workspaces. Via this option, you can not
change format of objects in already existing models.
To change format of objects in existing models
»

Right-click the Workspace and select Workspace Format.

The format will be applied for all objects that have the same format as the format of
Workspace, and objects that you will create on the Workspace. Example: Your Workspace
(WS) has two entities - Entity1 (red brush color) and Entity 2 (white brush color). Brush
color set up for your Workspace is white. If you change it to blue, brush color of Entity2
will also change. Entity1 will remain red. If you create Entity3, it will be blue.

General Tab

Description

Toad Data Modeler User Guide
Projects and Models

Auto
Complete

This option automatically adds newly created objects
to all Workspaces where this option is enabled.
Tip: Select Settings | Options | Physical Model |
General tab where you can:
a] Select the Auto Complete checkbox
Result: All Workspaces in all new models you will
create will have this option enabled. See the WS
format of the Workspaces.
b] Clear the Auto Complete checkbox
Result: In a new model that you will create, only first
WS All Items will have this option enabled. Why this WS is meant as Main Model, other WSs work like
submodels. If you add an entity to WS2,WS3..., it will
be automatically added to All Items (Main model).

Display Line
Names

Clear this option to hide relationship names, select
this option to display relationship names.

Right Angled
Lines

Select it to turn on the right angled line mode for the
given WS.

Font Settings

Click it to select a type of font, its style, size etc.

Line Tab

Description

Lock Points in
Right Angled
Mode

If this option is checked and you move with the end
shape, the line tries to retain all inner points while
staying right angled. In other cases, it tries to produce
an optimal right angled line according to Z or L style.
This option is active only if right angled mode for the
given Workspace or line is checked.

Shape Tab

Description

Recalculate
Size

Select this option to automatically adjust size of
object (entity, note) to the length of the text
contained.

Shadow Effect

Displays shadow in ER diagram.

Use Brush
Color for Full
Shape

Fills the object full shape with appropriate color.

Note Line
Tab

Description

63

Toad Data Modeler User Guide
Projects and Models

End Type 1, 2

Options to select format of ending of Lines.

Entity Tab

Description

Display
options

Define display options for entities. Options for
Physical model differ from those in Logical model.

To change format of a particular object
»

Right-click the object on Workspace and select Format.
Tips:
1. You can re-arrange the objects on the Workspace in different layers. See
"Arrange Objects in Layers" (page 336) for more information.
2. If you need to preserve format of a particular object against changes of
format of your WS, select the Lock Format option in the Object Format
dialog | Generaltab.

Related Topics
Format Physical Objects (page 86)
Format Logical Objects (page 292)
Designer and Workspace (page 39)
Select Objects
Physical Model Pointer and Objects Selection tool options

Logical Model Pointer and Objects Selection tool options

64

Toad Data Modeler User Guide

65

Projects and Models

Metamodel Pointer and Objects Selection tool options

Select Links Automatically—also available from Objects menu. By default enabled. When
enabled, lines/relationships between selected objects are selected automatically. During one
selecting process you can enable and disable this option several times to select only certain
lines/relationships.
To select multiple objects on Workspace, you have the following options:
l

Press SHIFT and click the particular objects on WS. This option works regardless settings
in Pointer and Objects Selection tool on the toolbar.

l

Drag your mouse over the objects on WS. (Works only for adjoining objects.)
Note: If you drag your mouse from the left side, only the objects that are entire in
the frame will be selected. If you drag your mouse from the right side, even objects
that are partly in the frame will be selected. - See the following example.
Example:
You want to select the Customer and Order Record entities. In Pointer and
Objects Selection tool, you must set either Select All (relationships will be also
selected), Select Entities or Select All Shapes. Drag your mouse from the left side
as long as both entities are completely in the frame (see the following image).

Toad Data Modeler User Guide

66

Projects and Models

Release your mouse button. Objects have been selected.

The result would be the same if you dragged your mouse from the right side and included
even a small part of the two entities in the frame.

Tip: To select all objects on WS, select Edit | Select All.

Toad Data Modeler User Guide

67

Projects and Models

To select more objects on WS by category or schema/owner
1. Right-click the Workspace | Select Objects.
2. Define a category or owner, or category and owner and click Select.

To select child and parent objects of the selected entity on the Workspace
»

Right-click the selected entity and select Select Parent Objects or Select Child Objects or
Select Parent and Child Objects.

To select multiple objects in Model Explorer and grids (e.g. Entity Properties form)
»

Use SHIFT or CTRL keys.

Related Topics
Object Viewer
Search Objects
Align Objects
1. In the workspace, select objects you want to align. (Decide what object will be the first
you select as the objects are aligned by the first selected object.)
2. Click

on the toolbar and the Align Palette opens.

3. Select the way to align the objects.

Note: You can also select Objects menu and one of the options under
Arrange, Align, Match Size or Space sub-menus.

Toad Data Modeler User Guide

68

Projects and Models

Related Topics
Select Objects
Rename Objects
To rename objects on the Workspace
1. Select the object (entity, view etc.), press F2 or CTRL+double-click the object name.
2. Write a new name.
3. Click the Workspace then.
To rename object in Model Explorer
»

Select the object and press F2 or right-click and select Rename.

Related Topics
Inplace Editor (page 46)
Copy Objects
To copy objects on the Workspace and between Workspaces, you can select from the
following option:
l

Drag&Drop techniques + CTRL on the Workspace

l

Select Edit | Copy/Paste, or via shortcuts CTRL+C, CTRL+V

To copy objects in Model Explorer
»

Use Drag&Drop techniques + CTRL

To copy objects in a dialog of particular object (Model menu, Model Items | Entities,
Views etc.)
»

Use Drag&Drop techniques + CTRL

You can copy objects between models of the same or different database system.
Combinations of these copy methods are possible - e.g. copy from Model Explorer to Workspace.
See "A. Drag&Drop techniques + CTRL on the Workspace" (page 94) for more information
Tips:
l

To copy more objects at one jump, make multiple selection and select one of the copy
techniques.

l

Making a Copy of Multiple Objects in Workspace (CTRL+A, CTRL+C, CTRL+V):
Before you press CTRL+V to paste the objects, close the Model Explorer dialog to

Toad Data Modeler User Guide

69

Projects and Models

accomplish the operation much faster. (The larger your model is, the more significant
difference in speed you will notice.)

Move Objects
To move objects on the Workspace, you can select from the following option: 
l

Drag&Drop techniques

l

Select Edit | Cut/Paste, or via shortcuts CTRL+X, CTRL+V

l

Keyboard arrows
Tip: To set up a size of a step for moving shapes on Workspace, select Settings |
Options | Application | Graphics | Move Objects by (mm/10) (in tenths of
millimeters).

To move objects in Model Explorers
»

Use Drag&Drop techniques

To move objects in a dialog of particular object (Model menu, Model Items | Entities,
Views etc.)
»

Use Drag&Drop techniques

You can move objects between models of the same or different database system.
Combinations of these methods are possible - e.g.between Model Explorer of two models.
See "Move EntitiesIn Toad Data Modeler there are several methods how to move entities. You
can select from the following options.To move entities within a Workspace, useDrag&Drop
techniquesorKeyboard arrowsTips:Select Settings | Options | Graphics | Move Objects by
(mm/10) to set up the size of a step to move (in tenths of millimeters).Select an entity, press
SHIFT, hold it down and use the keyboard arrows to change size of the entity box. To move
more entities on the WS at one jumpMake multiple selection of entities. See Select Objects for
more information.Point your mouse cursor at any selected object, click and hold the mouse
button down. Drag the objects to the required position. A whole bloc of all selected entities will
move, including their relationships.Tips:In the Objects menu, see the following two
options:Select Links Automatically - Enable this option if you want to select the relationships of
related entities automatically while making the multiple selection via SHIFT key in WS.
Recalculate on Move - Enable this option if you want to recalculate and see position of
relationships while moving the bloc of objects.To move an entity in a straight line, drag it and
then press and hold SHIFT key.To move an entity with its relationship, including handle points,
select the entity and the appropriate relationship (use SHIFT) and drag the entity. -> Selected
entity, relationship and its handle points will move too. To move entities to another Workspace
or another model, select from the following options:Cut&Paste functions: Edit | Cut/Paste, or via
shortcuts CTRL+X, CTRL+VDrag&Drop techniques between the Entities dialogs of two
different modelsDrag&Drop techniques between the Entities dialog and Model
ExplorerDrag&Drop techniques in or from Model ExplorerDrag&Drop techniques between

Toad Data Modeler User Guide

70

Projects and Models

Entities dialog/Model Explorer and Workspace Example: Moving an entity between two models
via Model Explorer. An entity will be moved from Model A to Model B.Version A: Moving an
entity between Model Explorers of the two models.Open Model Explorers for both models. You
can leave them undocked, or at least one of them to be able to drag the entity between
them.Select an entity in Model Explorer A | Entities folder, and hold the mouse button
down.Drag the entity to the Entities folder of the Model Explorer B. Version B: Moving an
entity from Model Explorer A directly to a Workspace of Model B.Undock the Model Explorer
A if it's docked, and click the Workspace tab of Model B in the Application Window.Select an
entity in Model Explorer A and hold the mouse button down.Drag the entity to a Workspace of
Model B. Related TopicsModel Explorer" (page 1) for more information and examples.
Tips:
1. To move more objects at one jump, make multiple selection and select one of the
move methods.
2. To see position of relationships when moving entity or entities on the Workspace, select
Objects | Recalculate on Move.
3. To move an entity in a straight line, drag it and then press and hold SHIFT key.
4. To move an entity with its relationship, including all handle points, select the entity
and the appropriate relationship (use SHIFT) and drag and drop the entity. -> Selected
entity, relationship and its handle points will move too. Position of handle points will
be preserved.

Delete Objects
In Toad Data Modeler, there are two deletion options (see the Objects menu):
l

Remove from Workspace (Delete) - Removes an object shortcut from a Workspace.

l

Delete Object - Deletes an object with all its shortcuts from model.

Example:
Your model has two Workspaces - WS1 and WS2. You add a new entity to your model. -> The
entity (its shortcuts) is contained on both Workspaces (- Auto Complete option is enabled).
However, you need to have the new entity on WS1 only.
Solution: You select the entity on the WS2 and simply press Delete.
Result: The entity shortcut in WS2 will be removed. Shortcut in WS1 will remain. The entity still
exists in your model.
If you wanted to delete the entity from your model completely (including all its shortcuts from
all Workspaces), you would select the Delete Object option (or press SHIFT+Delete). For the
deletion, you could select any entity shortcut on any WS - either WS1 or WS2. The entity would
be deleted from your model.

Toad Data Modeler User Guide

71

Projects and Models

To remove shortcut of object from Workspace
»

Select an object (shortcut of object) on the WS and press Delete.
Tip: You can delete shortcuts in Model Explorer too - select particular shortcut
of an object in the Shortcuts folder | right-click | Delete Item.

To delete objects from model (including all its shortcuts)
»

Select the shortcut of object on Workspace and press SHIFT+Delete.
Tip: You can also delete the objects:
l

In Model Explorer - select an object | right-click | Delete Item.

l

In the Object dialog (Model menu | Model Items | Entities, Relationships
etc.) - select the object and click Delete.

When you press Delete or SHIFT+ Delete in your ER diagram, the following message
will display:

Select the action you want to perform.
Note: Key shortcuts: ALT+O for OK and ALT+C for Cancel.
To set the default Delete options in Toad Data Modeler:
»

Select Settings | Options | Dialog Boxes | Other tab.

Option

Description

Display Dialog

Whenever you press Delete or SHIFT+Delete in your
ER diagram, the Delete Confirmation Dialog will
pop up and you will be able to select what action
you want to perform in particular case.

Remove

If this option is selected, the Delete will always

Toad Data Modeler User Guide

72

Projects and Models

Option

Description

Graphical
Representative
of Object

remove selected shortcut(s) of object from particular
Workspace. SHIFT+Delete will have to be used to
completely delete an object from your model.

Delete Object

If this option is selected, the Delete will completely
delete selected object(s) from your model, including
all the object shortcuts. There is no option to only
remove selected shortcut(s) of object. (The Delete will
replace SHIFT+Delete.)

Related Topics
Shortcuts of Objects (page 72)
Select Objects Physical Model Pointer and Objects Selection tool optionsLogical Model Pointer
and Objects Selection tool optionsMetamodel Pointer and Objects Selection tool optionsSelect
Links Automatically—also available from Objects menu. By default enabled. When enabled,
lines/relationships between selected objects are selected automatically. During one selecting
process you can enable and disable this option several times to select only certain
lines/relationships. To select multiple objects on Workspace, you have the following
options:Press SHIFT and click the particular objects on WS. This option works regardless
settings in Pointer and Objects Selection tool on the toolbar.Drag your mouse over the objects
on WS. (Works only for adjoining objects.)Note: If you drag your mouse from the left side, only
the objects that are entire in the frame will be selected. If you drag your mouse from the right
side, even objects that are partly in the frame will be selected. - See the following
example.Example:You want to select the Customer and Order Record entities. In Pointer and
Objects Selection tool, you must set either Select All (relationships will be also selected), Select
Entities or Select All Shapes. Drag your mouse from the left side as long as both entities are
completely in the frame (see the following image).Release your mouse button. Objects have been
selected.The result would be the same if you dragged your mouse from the right side and
included even a small part of the two entities in the frame. Tip: To select all objects on WS,
select Edit | Select All. To select more objects on WS by category or schema/ownerRight-click
the Workspace | Select Objects.Define a category or owner, or category and owner and click
Select. To select child and parent objects of the selected entity on the WorkspaceRight-click
the selected entity and select Select Parent Objects or Select Child Objects or Select Parent and
Child Objects.To select multiple objects in Model Explorer and grids (e.g. Entity Properties form)
Use SHIFT or CTRL keys. Related TopicsObject ViewerSearch Objects (page 1)
Shortcuts of Objects
About Shortcuts of Objects
In Toad Data Modeler, you can create multiple representatives of an object in one Workspace or
more Workspaces.

Toad Data Modeler User Guide

73

Projects and Models

l

A shortcut is a graphical representative of an object in the Workspace (WS). It is not a
copy of an object.

l

A shortcut has neither higher, nor lower priority than its object and vice versa.

l

A shortcut has the same name as its object. Shortcuts are just numbered.

l

A shortcut has the same properties as its object. You can edit any shortcut - all changes
will be applied to all other shortcuts of this object automatically.

l

An object can have none or many shortcuts. Their number is not limited. Also, you don't
have to have a shortcut of an object displayed on any WS.

l

You can remove shortcuts from WS easily (Delete on WS).

l

You can set individual format for each single shortcut of the same object.

You can create shortcuts of these objects:
l

Entity

l

Relationship

l

Inheritance

l

View (Materialized View)

l

Note

l

Stamp

l

Category (caption of Category)

l

Image

You can use shortcuts:
l

For large models

l

While working on the Workspace

Examples:
1. Entity1 is related with Entity30 that is placed in the other end of your large model.
Solution: You can create shortcuts for both entities and place them closer to each other.
(This example is shown in User Guide, "Shortcuts of Objects" topic.)
2. You have divided your large model into several Workspaces. You need to have Entity1
on more Workspaces (WS). Solution: You can create shortcuts of this entity on each WS.
Graphical Example:
A shortcut of the Student entity has been created and used in another part of the model.
This way, the model has been logically divided into two blocs and become much clearer
and well arranged.

Toad Data Modeler User Guide

74

Projects and Models

Related Topics
Create ShortcutsToad Data Modeler allows you to create shortcuts of objects on Workspaces in
many ways and also from Model Explorer to a particular Workspace. See the following
options.To add a shortcut within a WorkspaceDrag&Drop techniques and CTRL+SHIFTThis
cannot be used for creating shortcuts of relationships and inheritance.Example:Create a shortcut
of the Customer entity on one WS - Borrowing WS:Click the Customer entity on the Borrowing
WS and hold the mouse key down.Press CTRL+SHIFT keys and hold them down.Drag the
Customer entity to any place on the work area (the mouse cursor will change its
appearance).Release the mouse button and then the keys. To add a shortcut from Model Explorer
to WorkspaceDrag&Drop techniques from Model Explorer to particular WSExample:Activate the
Workspace where you want to add a shortcut of the Customer entity.In Model Explorer, find the
Customer entity.Click the Customer entity and hold the mouse key down.Drag the Customer
entity to the WS (the mouse cursor will change its appearance).Release the mouse button and
then the keys.Tip: Have a look at the Shortcuts folder of the Customer entity in Model Explorer.
A new shortcut has been created.  To add a shortcut of the selected object(s) from one
Workspace to another WorkspaceRight-click the selected object(s) (e.g. entity) on the WS and
select: Add into Workspace to select the particular WS.orAdd into New Workspace to create a
new WS and add the shortcut there. The layout and format of the shortcuts remain preserved
when you use this option. To add a shortcut of related objects to particular entity on the
Workspace (including relationships)Right-click the entity and select from the following
options:Fill Parent Objects to add shortcuts of parent objects of the selected entity to the WS.Fill
Child Objects to add shortcuts of child objects of the selected entity to the WS.Fill Parent and
Child Objects to add shortcuts of parent and child objects of the selected entity to the WS. To
add a shortcut of object(s) to the selected WorkspaceRight-click the selected Workspace and
select:Add All Model Objects to Workspace to add shortcuts of all objects that exist in your
model.orAdd Selected Objects to Workspace to select shortcuts of those entities that are not
contained on the WS, and of those relationships/inheritances that are possible to create on this
WS. Related TopicsEdit ShortcutsRemove Shortcuts (page 1)
Create Shortcuts
Toad Data Modeler allows you to create shortcuts of objects on Workspaces in many ways and
also from Model Explorer to a particular Workspace. See the following options.

Toad Data Modeler User Guide

75

Projects and Models

To add a shortcut within a Workspace
»

Drag&Drop techniques and CTRL+SHIFT

This cannot be used for creating shortcuts of relationships and inheritance.
Example:
Create a shortcut of the Customer entity on one WS - Borrowing WS:
1. Click the Customer entity on the Borrowing WS and hold the mouse key down.
2. Press CTRL+SHIFT keys and hold them down.
3. Drag the Customer entity to any place on the work area (the mouse cursor will change its
appearance).
4. Release the mouse button and then the keys.
To add a shortcut from Model Explorer to Workspace
»

Drag&Drop techniques from Model Explorer to particular WS

Example:
1. Activate the Workspace where you want to add a shortcut of the Customer entity.
2. In Model Explorer, find the Customer entity.
3. Click the Customer entity and hold the mouse key down.
4. Drag the Customer entity to the WS (the mouse cursor will change its appearance).
5. Release the mouse button and then the keys.
Tip: Have a look at the Shortcuts folder of the Customer entity in Model Explorer. A new
shortcut has been created.
To add a shortcut of the selected object(s) from one Workspace to another Workspace
»

Right-click the selected object(s) (e.g. entity) on the WS and select:
l

Add into Workspace to select the particular WS.
or

l

Add into New Workspace to create a new WS and add the shortcut
there. The layout and format of the shortcuts remain preserved when you
use this option.

To add a shortcut of related objects to particular entity on the Workspace (including
relationships)
»

Right-click the entity and select from the following options:

Toad Data Modeler User Guide

76

Projects and Models

l

Fill Parent Objects to add shortcuts of parent objects of the selected
entity to the WS.

l

Fill Child Objects to add shortcuts of child objects of the selected
entity to the WS.

l

Fill Parent and Child Objects to add shortcuts of parent and child objects
of the selected entity to the WS.

To add a shortcut of object(s) to the selected Workspace
»

Right-click the selected Workspace and select:
l

Add All Model Objects to Workspace to add shortcuts of all objects that
exist in your model.
or

l

Add Selected Objects to Workspace to select shortcuts of those entities
that are not contained on the WS, and of those relationships/inheritances
that are possible to create on this WS.

Related Topics
Edit Shortcuts (page 76)
Shortcut Right-Click Options in Model Explorer (page 79)
Edit Shortcuts
To edit object property
»

Double-click the selected shortcut on the Workspace.

You can edit any shortcut you want. The changed properties will be automatically applied in
all shortcuts of the object. In fact, you edit properties of the object and can do it via any
graphical representative of the object.
To change format of a shortcut
»

Right-click the selected shortcut on the Workspace and select Format.

The changed format will be applied only for the selected shortcut. Toad Data Modeler allows
you to define a different format settings for shortcuts of the same object.

Related Topics

Toad Data Modeler User Guide

77

Projects and Models

Edit ObjectsToad Data Modeler allows you to edit objects from multiple places. See the
following options.To edit objects on the WorkspaceDouble-click or Enter the selected
object.Note: Right-click the selected object(s) to display a pop-up menu.To edit objects from
Model ExplorerFind the object in the tree and double-click it (or right-click).Note: Right-click
the object | Edit is also possible. Double-click in Model Explorer does not highlight the object
on the Workspace (WS)but opens the Object Properties dialog. To highlight the object on WS,
you need to expand the Shortcuts folder and double-click the object shortcut.To edit objects
from Objects menuSelect object on workspace or in Model Explorer.Select Objects | Edit... To
edit objects from Model menuSelect Model | Model Items | the object type (e.g. Entities). In the
dialog (Entities), select the object and click Edit. Buttons in Object Properties dialogs: - opens
the Application Variables formOK - confirms changes, the form/dialog will closeCancel - cancels
changes Apply- confirms changes (The changes will be saved and the form/dialog remains
opened for other edit.)Help - Help navigationNote: Objects of your model that have the Generate
checkbox disabled in their Properties dialogs are displayed in Model Explorer this way: Related
TopicsModel Explorer (page 1)Shortcuts of Objects (page 1)Features (page 1)Default Values
(page 1) (page 1)
Format Objects (page 62)
Entity Right-Click Options (page 99)
Remove and List Shortcuts
To remove a shortcut of object on the Workspace
»

Select a shortcut on the WS and press Delete.

Only the selected shortcut will be removed from the Workspace. The object itself still exists
in the model.
Tips:
1. Right-click the shortcut in Model Explorer and select Delete Item.
2. To remove more shortcuts on WS at one jump, make multiple selection and then
press Delete.
See "Delete ObjectsIn Toad Data Modeler, there are two deletion options (see the Objects menu):
Remove from Workspace (Delete) - Removes an object shortcut from a Workspace. Delete
Object - Deletes an object with all its shortcuts from model.Example:Your model has two
Workspaces - WS1 and WS2. You add a new entity to your model. -> The entity (its shortcuts)
is contained on both Workspaces (- Auto Complete option is enabled). However, you need to
have the new entity on WS1 only.Solution: You select the entity on the WS2 and simply press
Delete. Result: The entity shortcut in WS2 will be removed. Shortcut in WS1 will remain. The
entity still exists in your model. If you wanted to delete the entity from your model completely
(including all its shortcuts from all Workspaces), you would select the Delete Object option (or
press SHIFT+Delete). For the deletion, you could select any entity shortcut on any WS - either
WS1 or WS2. The entity would be deleted from your model. To remove shortcut of object from
WorkspaceSelect an object (shortcut of object) on the WS and press Delete.Tip: You can delete
shortcuts in Model Explorer too - select particular shortcut of an object in the Shortcuts folder |

Toad Data Modeler User Guide

78

Projects and Models

right-click | Delete Item.To delete objects from model (including all its shortcuts) Select the
shortcut of object on Workspace and press SHIFT+Delete.Tip: You can also delete the objects:In
Model Explorer - select an object | right-click | Delete Item.In the Object dialog (Model menu |
Model Items | Entities, Relationships etc.) - select the object and click Delete.When you press
Delete or SHIFT+Delete in your ER diagram, the following message will display:Select the
action you want to perform.Note: Key shortcuts: ALT+O for OK and ALT+C for Cancel. To set
the default Delete options in Toad Data Modeler:Select Settings | Options | Dialog Boxes | Other
tab.OptionDescriptionDisplay DialogWhenever you press Delete or SHIFT+Delete in your ER
diagram, the Delete Confirmation Dialog will pop up and you will be able to select what action
you want to perform in particular case.Remove Graphical Representative of ObjectIf this option
is selected, the Delete will always remove selected shortcut (s) of object from particular
Workspace. SHIFT+Delete will have to be used to completely delete an object from your model.
Delete ObjectIf this option is selected, the Delete will completely delete selected object(s) from
your model, including all the object shortcuts. There is no option to only remove selected
shortcut (s) of object. (The Delete will replace SHIFT+Delete.)  Related TopicsShortcuts of
Objects (page 1) Select Objects Physical Model Pointer and Objects Selection tool
optionsLogical Model Pointer and Objects Selection tool optionsMetamodel Pointer and Objects
Selection tool optionsSelect Links Automatically—also available from Objects menu. By default
enabled. When enabled, lines/relationships between selected objects are selected automatically.
During one selecting process you can enable and disable this option several times to select only
certain lines/relationships. To select multiple objects on Workspace, you have the following
options:Press SHIFT and click the particular objects on WS. This option works regardless
settings in Pointer and Objects Selection tool on the toolbar.Drag your mouse over the objects
on WS. (Works only for adjoining objects.)Note: If you drag your mouse from the left side, only
the objects that are entire in the frame will be selected. If you drag your mouse from the right
side, even objects that are partly in the frame will be selected. - See the following
example.Example:You want to select the Customer and Order Record entities. In Pointer and
Objects Selection tool, you must set either Select All (relationships will be also selected), Select
Entities or Select All Shapes. Drag your mouse from the left side as long as both entities are
completely in the frame (see the following image).Release your mouse button. Objects have been
selected.The result would be the same if you dragged your mouse from the right side and
included even a small part of the two entities in the frame. Tip: To select all objects on WS,
select Edit | Select All. To select more objects on WS by category or schema/ownerRight-click
the Workspace | Select Objects.Define a category or owner, or category and owner and click
Select. To select child and parent objects of the selected entity on the WorkspaceRight-click
the selected entity and select Select Parent Objects or Select Child Objects or Select Parent and
Child Objects.To select multiple objects in Model Explorer and grids (e.g. Entity Properties form)
Use SHIFT or CTRL keys. Related TopicsObject ViewerSearch Objects (page 1)" (page 1) for
more information about deletion options in Toad Data Modeler.

List Shortcuts
To list all shortcuts that exist in your model see Model Explorer and the following folders.

Toad Data Modeler User Guide

79

Projects and Models

To see all shortcuts by object type (entity, relationship, inheritance)
»

Select the particular object folder (e.g. Entities) | Shortcuts folder. Here, you can also see
names of the Workspaces where the particular shortcut occurs.

To see all shortcuts by Workspace
»

Click the Workspaces folder | particular workspace folder (e.g. Ordering) | Entity
Shortcuts, Relationship Shortcuts, View Shortcuts.

To find shortcuts of objects on the Workspace quickly
»

Double-click the shortcut in Model Explorer to highlight it on the Workspace.

Shortcut Right-Click Options in Model Explorer
Right-click a shortcut in Model Explorer to see the following options:
Option

Description

Find Object

Finds the selected shortcut on WS and highlights it.

Edit

Opens the Object Properties dialog.

Delete Item

Removes the shortcut from Workspace.

Right-click an entity shortcut in Model Explorer to see other options:
Option

Description

Fill Parent
Objects

Displays shortcuts of parent objects of the selected
entity on Workspace.

Fill Child
Objects

Displays shortcuts of child objects of the selected
entity on Workspace.

Fill Parent and
Child Objects

Displays shortcuts of parent and child objects of the
selected entity on Workspace.

Model Independent Graphics
2-D Shapes
Toad Data Modeler allows you to insert the following 2-D shapes to your ER diagram:

Toad Data Modeler User Guide

80

Projects and Models

l

Note

l

Line

l

Image

l

Rectangle

l

Ellipse

l

Text

l

Label Quadrangle

l

Label Ellipse

The objects are available on the toolbar and in the Objects| Add New menu for both physical
and logical model.
To change format of these objects
»

Right-click the object and select Format.
Tip: Feel free to order the objects on the Workspace. See "Arrange Objects in
Layers" (page 336) for more information.

Related Topics
Designer and Workspace (page 39)
Format Objects (page 62)
Note and Line
A note can refer to a model, Workspace, particular entity, attribute, relationship etc.
To add a note to your model
1. Click

or select Objects | Add New | Note and click the work area.

2. Double-click the Note to edit it.
3. Write a text on tab General. The automatic word wrap function is available.
Tip: To change a format of Note, right-click it and select Format. To adjust the size of a Note to
a length of text contained, click the Shape tab and select Recalculate Size.

Note Shortcuts
You can create shortcuts of Notes.
Example: You have a Note to the Customer entity. This entity occurs in WS1 and WS3.
You want to have the Note to this entity in both Workspaces. Solution: Create another
shortcut of this Note.

Toad Data Modeler User Guide

81

Projects and Models

To make a connection between a Note and an object that the note relates to, you can use a Line.
Lines
To add a Line
1. Click

or select Objects | Line.

2. Click the object and then click the Note.
To change the look of the ending of lines on the Workspace
1. Right-click the WS and select Workspace Format.
2. Click the Line tab and select the line for end types.

Related Topics
Shortcuts of Objects (page 72)
Image
Logos and other images can be added to your ER diagrams. Lines can be used to make a relation
between image and another shape, for example entity, view, note etc.
To insert an image
1. Click

on the toolbar (or select Objects | Add New | Image).

2. Click on the Workspace where you want to insert the image.
3. Select the image from the Open dialog and click Open.

Note: Images that you insert to your ER diagrams aren't saved together with your model.

Toad Data Modeler User Guide

82

Projects and Models

To edit an image
»

Double-click the image on the Workspace.

Image in Model Explorer
Take notice of the Image item in Model Explorer. From here you can manage your
images as well.

Image and Shortcuts
You can add shortcuts of an image to every Workspace of your model. Also, you can add as
many shortcuts to one WS as you need.
If you edit an image, the changes will be applied in all its shortcuts.

Related Topics
Shortcuts of Objects (page 72)
Stamp
Add a Stamp to the Workspace to display information about your model, e.g. Author, Company,
Date of Creation etc.
To add a stamp
Click

on the toolbar (or select Objects | Add New | Stamp), and click the work area.

2. To change a format of the Stamp, right-click it and select Format.
To edit a stamp
»

Double-click the Stamp on the Workspace.

Toad Data Modeler User Guide

83

Projects and Models

Tip: You can edit content of the Stamp also via Model | Model Properties.

Stamp and Shortcuts
You can add shortcuts of a Stamp to every Workspace of your model. Also, you can add as many
shortcuts of a Stamp to one Workspace as you need.
If you edit a Stamp, the changes will be applied in all its shortcuts.

Related Topics
Model Statistics (page 399)
Shortcuts of Objects (page 72)
Caption of Categories
Caption of Categories displays a list of all categories of your model and their colors. From here,
you can also add, edit and delete categories.
See "Categories" (page 381) for more information
To add a Caption of Categories
1. Click Category

or select Model | Category.

2. To change a format of the caption, right-click and select Format.

Caption of Categories and Shortcuts
You can create shortcuts of Caption of Categories and add them to several Workspaces.
Example:
You have created several Categories and colorfully distinguished objects on WS that logically
match together. As some of the objects occur in more Workspaces, you want to display the
caption of categories there too. Solution:
1. Right-click the existing Caption of Categories on the WS and select Add into
Workspace.
2. From the list of Workspaces, select the required WS.

Related Topics

Toad Data Modeler User Guide

84

Projects and Models

Shortcuts of Objects (page 72)

Physical Data Model
About Physical Data Modeling
Toad Data Modeler allows you to design Entity Relationship Diagrams of particular database
platform, convert physical model from one database platform to another, load ER Diagram
directly from your database (Reverse Engineering feature, loading of DDL scripts), update
physical models, generate DDL/SQL scripts and also alter scripts, create Dictionary Types,
Views, Triggers, Functions, generate detailed documentation to your model (HTML, RTF, PDF,
XSLT) and much more.
This chapter describes features and functions relating to Physical Data Modeling. Look around
each section to get the information you need.
Note: See the sample physical model Videorental (Oracle 10g db) that is included in the
installation package for Toad Data Modeler. Default location is: C:\Program Files\Quest
Software\Toad Data Modeler 5\Samples.

Related Topics
Basic Database Design (page 205)
About Reverse Engineering
Load Models from DDL/SQL Script
Import Toad Data Modeler 2.x Model
Import Toad for Oracle ER Diagrams (page 653)
Benefits of Physical Data Model
l

Detailed definition of database structure, including database specific items, for example:
l

stored procedures

l

functions

l

triggers

l

views

l

materialized views

l

sequences (autoincrements) etc.

l

Possibility to synchronize model with existing database .

l

Possibility to specify logical names for objects (captions for tables, attributes and
other objects).

Toad Data Modeler User Guide

85

Projects and Models

l

Detailed database specific information can be exported to HTML/RTF/PDF or
XML/XHTML/CSV reports.

l

Automatic generation of SQL code for selected objects (SQL code generation is not
available in Logical or Universal Model)

l

Automatic migration of PK attributes to child entities (Attributes don't migrate to child
entities in Logical Model)

Entity Relationship Diagram Objects
Objects in ER Diagram
Objects in ER Diagram
l

Entity (Table)

l

Relationship (Identifying, Non-identifying, M:N)

l

View

l

Materialized View (for particular databases only)

l

Image

l

Stamp

l

Category (Caption of Categories)

All these objects are available in the Objects menu or via icons on the Designer toolbar.
You can manage these objects:
l

Directly on the Workspace

l

Via the Model menu

l

In Model Explorer

Tips:
1. Besides these objects you can add also other graphical shapes to your ER diagram. See
"Model Independent Graphics" (page 79) for more information.
2. See "Arrange Objects in Layers" (page 336) for more information.

Related Topics
Model Menu (page 52)
Model Explorer (page 391)

Toad Data Modeler User Guide

86

Projects and Models

Shortcuts of Objects (page 72)
Format Physical Objects
This topic describes some options specific for formatting of physical objects only.
See "Format Objects" (page 62) for more information on general formatting of all objects on the
Workspace or a particular object.
1. Right-click the Workspace in your physical model and select Workspace Format.
2. Click the Entity tab.
Option

Description

Align

Aligns entity columns.

Display Data
Types

Displays Data Types in entity.

Display Keys
Graphically

Displays graphical icons of keys in
entity.

Display Level

Select items you want to display in
your ER diagram - Entities, Primary
Keys, PK and FK Keys, All Keys,
Attributes.
Note: See the Display Level box on
the toolbar (also View menu | Display
Level).

Gradient Effect

Displays gradient effect in ER diagram.

Display
Dictionary Types
as Data Types

Displays dictionary types as data types
in entity.

Display Indexes

Displays Indexes in entity.

To define different colors for attributes on your Workspace
»

Select Settings | Options | Model section | Physical Model | Entity tab | Attribute
Colors area.

Toad Data Modeler User Guide

87

Projects and Models

Related Topics
Designer and Workspace (page 39)
Entities
Create Entities
To create an entity in your model
»

Click

on the toolbar and then click anywhere on the work area (also CTRL+E).

Tip: To create multiple entities at one jump:
1. Press SHIFT and click the Entity icon. A blue frame displays on
the icon

.

2. Click the work area as many times as many entities you need to add.

Toad Data Modeler User Guide

88

Projects and Models

3. Right-click the work area (or click the Entity icon again) to turn this
function off.
or
Model Explorer | Right-click the Entities folder | Add Entity.
Note: Are entities added to other Workspaces automatically? - See "Format Objects" (page 62)
for more information.

Entity List
To see all entities of your model, you can select from the following options:
l

Select Model | Model Items | Entities to open the Entities dialog. Here, you can add, edit
entities, edit their names (F2) and delete them.

l

In Model Explorer, unfold the Entities folder. From here, you can also manage entities of
your model.

Related Topics
Create Entity with Attributes
Add Entities and Attributes Fast
Features (page 374)
Default Values (page 470)
Edit Entities
»

Double-click the entity on the Workspace.
or
Edit the entity in Model Explorer | Entities folder | double-click the selected
entity (or right-click | Edit).
Note: You can also edit entities in the Entities dialog (Model menu | Model
Items |Entities | Edit).

Example: The Entity Properties form (Oracle 10g db). Object navigator collapsed.

Toad Data Modeler User Guide
Projects and Models

Example of tab Attributes, Object Navigator expanded.

89

Toad Data Modeler User Guide
Projects and Models

Option

Description

Object Navigator
Box

All entities of your model are listed here. It
allows you to edit entities quickly and
comfortably from one place.
Tip: After you finish editing an entity, click
Apply to confirm changes and select another
entity from the Object Navigator box.
Buttons Previous and Next for quick navigation
among entities.

General Tab

General properties of entity

Caption

Logical name of entity

Name

Physical name of entity
See "Naming ConventionsAbout Naming
ConventionsToad Data Modeler allows you to
use naming conventions in your physical models.
What are naming conventions? Via naming
conventions you can:Define your own rules for
physical names of objects – e.g. add prefix or
suffix to the names, use only lower case
etc.Synchronize caption (logical name) and name
(physical name) of objects of your model.Verify
whether the physical names of objects match the
naming convention rules. If they don’t, you can
decide whether to apply them or not.Note:
Naming conventions always influence physical
names, NOT captions. Captions (logical names)
can be in various forms as they provide logical
information only. Naming Conventions in Toad
Data Modeler – Basic InformationNaming
conventions are supported for most objects of
physical model for which you can define a name
(physical name) and a caption (logical name).A
naming convention can be used in various models
across different database systems.You can use
them for new models, reversed models or models
that already exist in Toad Data Modeler.Every
defined naming convention is stored in external
.TXN file stored by default in your Documents
folder, directory Toad Data Modeler\ Installation
name\Naming Conventions.You can define only
one naming convention for one model.Toad Data

90

Toad Data Modeler User Guide
Projects and Models

Option

Description
Modeler allows you to:Automatically create
physical names based on logical names and
naming conventions rules. (Example: Customer
ID => T_ CUSTOMER_ ID). This feature makes
you more productive as you need significantly
less time to define both logical and physical
names.Define valid characters for physical names
and set how invalid characters should be
replaced.Use glossaries for automatic word
replacement during new objects creation.
Glossaries can be made of multiple CSV files and
you can easily turn on or turn off the selected
glossaries.Verify naming conventions and rewrite
physical names in a batch mode. Check your
model and replace physical names of objects that
don’t
match
naming
conventions
rules.Synchronize captions and names (without
specific
naming
convention
definitions).Import/export of glossaries (*.CSV
files) also from/to other tools.See the Naming
Convention Properties dialog | Glossary tab |
Import button.You can find some CSV files with
diacritical marks at: C:\Program Files\Quest
Software\Toad
Data
Modeler
3\Naming
Conventions\CSV.  Related
Topics
Basic
Operations " (page 1) for more information.
Tip: On the toolbar, feel free to select whether
you want to display physical names, logical
names or full names of your entities.

Schema

Schema selection box. Click the small button on
the right to access the Schema dialog.
(User/Schema stands only for Oracle models.)

Category

Category selection box. To see a list of
Categories of your model, click the small button
on the right.

Generate

Select it to generate the entity in final SQL
(DDL) script. (It is selected by default.)
Note: Objects of your model that have the

91

Toad Data Modeler User Guide
Projects and Models

Option

Description
Generate checkbox disabled in their Properties
dialogs are displayed in Model Explorer this way:

Note: Other options on the General tab vary depending on a target
database. See the specific options for your database in the "Databases"
chapter.
Attributes, Keys,
Indexes, Check
Constraints,
Triggers,
Permissions Tabs

On these tabs, you can add, edit and delete
particular items. More details on each of them can
be found in appropriate topics that follow.

To Do Tab

On this tab, you can write some tasks on the
selected entity.
Note: To see all To Do tasks, select Model | To
Do.

Before Script Tab

Whatever you write into the Before Script
section, it will be generated before the Entity
definition.

After Script Tab

Whatever you write into the After Script section,
it will be generated after the Entity definition.

Notes Tab

Write notes on the entity on this tab. The text
will display in a pop-up box when you point
your mouse cursor at the entity name in ER
diagram.
Note: CTRL+A, CTRL+C, CTRL+X and
CTRL+V functions are available on this tab.

SQL Preview Tab
Click
at the bottom of this tab to see the
part of SQL code for the entity.
Select the WordWrap checkbox to wrap the code
on this tab.
Tip: To select this option by default, select
Settings | Options | Physical Model | General tab
| Word Wrap for SQL Preview.
Relationships Tab

Information on parent and child entities,
relationships and key attributes.

92

Toad Data Modeler User Guide
Projects and Models

Option

Description
Double-click the selected object to open the
Properties dialog.

Physical
Properties Tab

Storage characteristics of table can be defined on
this tab.

Table Properties
Tab

Other table characteristics can be defined here.

Comment Tab

Write comments on the entity on this tab.
Note: CTRL+A, CTRL+C, CTRL+X and
CTRL+V functions are available on this tab.

Buttons:
- opens the Application Variables form
OK - confirms all changes and closes the form
Cancel - cancels the changes you have made and closes the form
Apply - confirms the changes (the form will remain opened for further edit)
Help - opens Help file

Related Topics
Inplace Editor (page 46)
Object Navigator Box (page 402)
Autolayout (page 333)
Arrange Objects in Layers (page 336)
Resize Objects
Format Objects (page 62)
Features (page 374)
Copy Entities
In Toad Data Modeler there are several methods and places where to copy entities. You can
select from the following options.

93

Toad Data Modeler User Guide

94

Projects and Models

A. Drag&Drop techniques + CTRL on the Workspace
Use: Within one Workspace
Example:
1. Click an entity on the WS and hold the mouse button down.
2. Press CTRL.
3. Drag the entity to another place.
4. Release the mouse button and key.

B. Copy&Paste functions: Edit | Copy/Paste
(CTRL+C, CTRL+V)
Use:
l

Within a Workspace

l

Between Workspaces

l

Between Models

Example: Making a copy of an entity within a WS.
1. Select an entity.
2. Press CTRL+C.
(If you copy the entity to another WS of the same model or to another WS of another
model, click the appropriate tab of the Workspace in the Application Window before the
next step.)
3. Press CTRL+V
4. The new entity has been copied on top of the original entity. Drag the entity to change
its position.

C. In the Entities dialog: Drag&Drop techniques
+ CTRL
Use:
l

In the Entities dialog itself (Model | Model Items | Entities)

l

From the Entities dialog to a Workspace and vice versa

Toad Data Modeler User Guide

95

Projects and Models

l

Between the Entities dialog and Model Explorer | Entities folder

l

Between the Entities dialogs of two different models

Example: Making a copy of an entity between the Entities dialog of Model A to Model
Explorer of Model B:
1. Open the Entities dialog in Model A: Model | Entities.
2. Open the Model Explorer for Model B.
3. Select an entity in the Entities dialog, press CTRL and hold it down.
4. Drag the entity to the Entities folder in Model Explorer.

D. In Model Explorer: Drag&Drop techniques +
CTRL
Use:
l

In Model Explorer itself

l

From Model Explorer to a Workspace

l

Between Model Explorer and the Entities dialog (also of a different model), and
vice versa

l

Between two Model Explorers | Entities folder of two different models

See the following examples:
Example 1: Making a copy of an entity in Model Explorer.
1. Unfold the Entities folder in the Model Explorer tree.
2. Click an entity and hold the mouse button down.
3. Press CTRL.
4. Drag the entity to the Entities folder.
Result: A copy of the selected entity is listed in the Model Explorer tree and the entity shortcut
occurs in all the Workspaces of your model where the Auto Complete option is selected.
Example 2: Making a copy of an entity from Model Explorer to a Workspace.
1. Unfold the Entities folder in the Model Explorer tree.
2. Click an entity and hold the mouse button down.
3. Press CTRL.
4. Drag the entity to a Workspace in the Application Window.

Toad Data Modeler User Guide

96

Projects and Models

Example 3: Making a copy of an entity between Model Explorers of two models. An entity will
be copied from Model A to Model B:
1. Open Model Explorers for both models. You can leave them undocked, or at least one of
them, so as to be able to drag the copied entity between them.
2. Click an entity in Model Explorer A and hold the mouse button down.
3. Press CTRL.
4. Drag the entity to the Entities folder of the Model Explorer B.

Other Notes
l

An entity is copied with all its properties.

l

It's possible to copy objects between models of a different database. However, some
specific object properties cannot be copied - properties that are in the source model but
do not exist in target model. E.g. Copy of entity from MS SQL 2005 to MySQL 5.1. Entity A has Partition Schema, Entity B has Fulltext Catalog. In these cases, the entities
will not be copied to MySQL model.

Related Topics
Model Explorer (page 391)
Move Entities
In Toad Data Modeler there are several methods how to move entities. You can select from the
following options.
To move entities within a Workspace, use
»

Drag&Drop techniques
or
Keyboard arrows

Tips:
1. Select Settings | Options | Graphics | Move Objects by (mm/10) to set up the size of a
step to move (in tenths of millimeters).
2. Select an entity, press SHIFT, hold it down and use the keyboard arrows to change size of
the entity box.

Toad Data Modeler User Guide

97

Projects and Models

To move more entities on the WS at one jump
1. Make multiple selection of entities. See "Select Objects Physical Model Pointer and
Objects Selection tool optionsLogical Model Pointer and Objects Selection tool
optionsMetamodel Pointer and Objects Selection tool optionsSelect Links
Automatically—also available from Objects menu. By default enabled. When enabled,
lines/relationships between selected objects are selected automatically. During one
selecting process you can enable and disable this option several times to select only
certain lines/relationships. To select multiple objects on Workspace, you have the
following options:Press SHIFT and click the particular objects on WS. This option works
regardless settings in Pointer and Objects Selection tool on the toolbar.Drag your mouse
over the objects on WS. (Works only for adjoining objects.)Note: If you drag your mouse
from the left side, only the objects that are entire in the frame will be selected. If you drag
your mouse from the right side, even objects that are partly in the frame will be selected. See the following example.Example:You want to select the Customer and Order Record
entities. In Pointer and Objects Selection tool, you must set either Select All
(relationships will be also selected), Select Entities or Select All Shapes. Drag your mouse
from the left side as long as both entities are completely in the frame (see the following
image).Release your mouse button. Objects have been selected.The result would be the
same if you dragged your mouse from the right side and included even a small part of the
two entities in the frame. Tip: To select all objects on WS, select Edit | Select All. To
select more objects on WS by category or schema/ownerRight-click the Workspace |
Select Objects.Define a category or owner, or category and owner and click Select. To
select child and parent objects of the selected entity on the WorkspaceRight-click the
selected entity and select Select Parent Objects or Select Child Objects or Select Parent
and Child Objects.To select multiple objects in Model Explorer and grids (e.g. Entity
Properties form)Use SHIFT or CTRL keys. Related TopicsObject ViewerSearch Objects"
(page 1) for more information.
2. Point your mouse cursor at any selected object, click and hold the mouse button down.
3. Drag the objects to the required position. A whole bloc of all selected entities will move,
including their relationships.
Tips:
1. In the Objects menu, see the following two options:
l

Select Links Automatically - Enable this option if you want to select the
relationships of related entities automatically while making the multiple
selection via SHIFT key in WS.

l

Recalculate on Move - Enable this option if you want to recalculate and
see position of relationships while moving the bloc of objects.

2. To move an entity in a straight line, drag it and then press and hold SHIFT key.
3. To move an entity with its relationship, including handle points, select the entity and the
appropriate relationship (use SHIFT) and drag the entity. -> Selected entity, relationship
and its handle points will move too.

Toad Data Modeler User Guide

98

Projects and Models

To move entities to another Workspace or another model, select from the following options:
l

Cut&Paste functions: Edit | Cut/Paste, or via shortcuts CTRL+X, CTRL+V

l

Drag&Drop techniques between the Entities dialogs of two different models

l

Drag&Drop techniques between the Entities dialog and Model Explorer

l

Drag&Drop techniques in or from Model Explorer

l

Drag&Drop techniques between Entities dialog/Model Explorer and Workspace

Example: Moving an entity between two models via Model Explorer. An entity will be moved
from Model A to Model B.
Version A: Moving an entity between Model Explorers of the two models.
1. Open Model Explorers for both models. You can leave them undocked, or at least one of
them to be able to drag the entity between them.
2. Select an entity in Model Explorer A | Entities folder, and hold the mouse button down.
3. Drag the entity to the Entities folder of the Model Explorer B.
Version B: Moving an entity from Model Explorer A directly to a Workspace of Model B.
1. Undock the Model Explorer A if it's docked, and click the Workspace tab of Model B in
the Application Window.
2. Select an entity in Model Explorer A and hold the mouse button down.
3. Drag the entity to a Workspace of Model B.

Related Topics
Model Explorer (page 391)

Toad Data Modeler User Guide
Projects and Models

Entity Right-Click Options
Right-click the selected entity on the Workspace to see the following options:

Option

Description

Format

Opens the Object Format dialog for the
selected entity.

Add into Workspace

Opens the Workspaces dialog where you
can select a WS to add the entity to.

Add into New
Workspace

Creates a new Workspace in the
Application Window and adds the entity to
it.

Remove from Workspace

Removes the selected shortcut from
particular Workspace.

99

Toad Data Modeler User Guide
Projects and Models

Option

Description

Delete Object

Deletes selected entity from model.

Arrange

Arranges the entity in another layer.
See "Arrange Objects in Layers" (page 336)
for more information.

Add Object to Gallery

Adds objects to selected Gallery.

Recalculate Size

Adjusts the entity size to the length of its
columns.

Set Same Size for the
Selected Objects

Resizes other selected objects on the
Workspace to match the size of the selected
entity.

Align Self Relationship

Aligns self relationship.

Edit

Opens the Entity Properties form.

Add

Creates new object (Attribute, Key or
Index)

Edit Attribute...

Opens Attribute Properties form (the item is
active if attribute is selected)

Select
Select Parent Objects

Selects parent objects of the selected entity
on the Workspace.

Select Child Objects

Selects child objects of the selected entity
on the Workspace.

Select Parent and Child
Objects

Selects parent and child objects of the
selected entity on the Workspace.
Tip: Use these options for next multiple
copy, move, format change etc.

Fill
Fill Parent Objects

Displays shortcuts of parent objects of the
selected entity on Workspace.

Fill Child Objects

Displays shortcuts of child objects of the
selected entity on Workspace.

Fill Parent and Child
Objects

Displays shortcuts of parent and child
objects of the selected entity on

100

Toad Data Modeler User Guide
Projects and Models

Option

Description
Workspace.

Add to Category

Adds object to selected category.

Macros

Shows available macros for the selected
entity.

Attributes
Create Attributes
You can create attributes in:
l

Entity Properties form

l

Attribute Properties dialog

l

Model Explorer

To create an attribute in the Entity Properties form
1. Double-click the entity on the Workspace.

101

Toad Data Modeler User Guide

102

Projects and Models

2. In the Entity Properties form, select the Attributes tab and click Add.

Note: Confirm Apply to be able to edit the attribute.
Tips:
l

To quickly create an attribute with default settings and the name you define, write the
attribute name to the text box placed at the bottom left-hand corner of the Entity
Properties form and click the smaller Add button.

l

In Entity Properties form | Attributes tab | click the last attribute and press the down
arrow key on your keyboard.

To create another attribute in the Attribute Properties form
»

Click OK+Add.

Toad Data Modeler User Guide

103

Projects and Models

Note: This is recommended when you are editing an attribute and need to create
another attribute for the entity.
To create an attribute in Model Explorer
»

Click the Entities folder | Unfold the selected entity. | Right-click the Attributes item. |
Add Attribute.

Example: Entity Properties form | Attributes tab (Oracle 10g db):

To create attribute in the Diagram
»

Right click entity and select Add | Attribute .

Toad Data Modeler User Guide
Projects and Models

Column/Option

Description

Key

Graphical representation of keys of particular
attributes

Caption

Logical attribute name

Name

Physical attribute name

Data Type

Data Type of an attribute
Tip: Before y ou create new attributes, set up a
default data type, including parameters, for particular
database. See the Settings menu | Options | Physical
Model | particular database version | Default Data
Type combo- box. (The selected data type will be
applied also for Dictionary Types and Domains.)

p1

Parameter 1. If a column data type is defined as

104

Toad Data Modeler User Guide

105

Projects and Models

Column/Option

Description
Number(x,y), then P1 displays Precision value and
P2 Scale value. If Varchar2(x) is defined as data type,
P1 displays Length etc.

p2

Parameter 2. If a column data type is defined as
Number(x,y), then P1 displays Precision value and
P2 Scale value. If Varchar2(x) is defined as data type,
P1 displays Length etc.

Not Null

The Not Null selection box

Comments

Comments or descriptions on the attribute

Status

Shows status of attributes in grid. See "Status of
Items in Grids" (page 47) for more information.

Buttons:
- opens the Application Variables form
small Add - adds new attributes quickly, just write an attribute name to the box next to this
button and then click Add.
Add - adds an attribute
Edit - opens the Attribute Properties dialog
Delete - deletes the selected attribute
- changes order of attribute

Related Topics
Create Entity with Attributes
Add Entities and Attributes Fast
Features (page 374)
Default Values (page 470)
Edit Attributes
»

In the Entity Properties dialog | Attributes tab, double-click the selected attribute.
or

Toad Data Modeler User Guide
Projects and Models

Find the attribute in Model Explorer | EntityName folder | Attributes | Doubleclick the selected attribute.
Example: The Attribute Properties dialog (Oracle 10g db):

Tab/Option

Description

Object
Navigator
Box

Object Navigator Box can be expanded or collapsed by
clicking the right black arrow in top right corner.
All attributes of the selected entity are listed here. The
combo-box allows you to edit attributes quickly and
comfortably from one place.

106

Toad Data Modeler User Guide
Projects and Models

Tab/Option

Description
Tips:
l

After you finish editing an attribute, click Apply
to confirm changes and select anotherattribute
from the Object Navigator box.

l

Possibility to set order of attributes listed in the
Navigator box in the Attribute Properties dialog.
Select Settings | Options | Physical Model |
General tab | Alphabetic Order in Attribute
Navigator List.

General
Tab

General properties of attribute

Caption

Logical column name

Name

Physical attribute name
See
"Naming
ConventionsAbout
Naming
ConventionsToad Data Modeler allows you to use
naming conventions in your physical models. What are
naming conventions? Via naming conventions you
can:Define your own rules for physical names of objects
– e.g. add prefix or suffix to the names, use only lower
case etc.Synchronize caption (logical name) and name
(physical name) of objects of your model.Verify whether
the physical names of objects match the naming
convention rules. If they don’t, you can decide whether
to apply them or not.Note: Naming conventions always
influence physical names, NOT captions. Captions
(logical names) can be in various forms as they provide
logical information only. Naming Conventions in Toad
Data Modeler – Basic InformationNaming conventions
are supported for most objects of physical model for
which you can define a name (physical name) and a
caption (logical name).A naming convention can be
used in various models across different database
systems.You can use them for new models, reversed
models or models that already exist in Toad Data
Modeler.Every defined naming convention is stored in
external .TXN file stored by default in your Documents
folder, directory Toad Data Modeler\ Installation
name\Naming Conventions.You can define only one
naming convention for one model.Toad Data Modeler
allows you to:Automatically create physical names
based on logical names and naming conventions rules.

107

Toad Data Modeler User Guide
Projects and Models

Tab/Option

Description
(Example: Customer ID => T_ CUSTOMER_ ID). This
feature makes you more productive as you need
significantly less time to define both logical and
physical names.Define valid characters for physical
names and set how invalid characters should be
replaced.Use glossaries for automatic word replacement
during new objects creation. Glossaries can be made of
multiple CSV files and you can easily turn on or turn off
the selected glossaries.Verify naming conventions and
rewrite physical names in a batch mode. Check your
model and replace physical names of objects that don’t
match naming conventions rules.Synchronize captions
and names (without specific naming convention
definitions).Import/export of glossaries (*.CSV files) also
from/to other tools.See the Naming Convention
Properties dialog | Glossary tab | Import button.You can
find some CSV files with diacritical marks at:
C:\Program Files\Quest Software\Toad Data Modeler
3\Naming Conventions\CSV.  Related Topics Basic
Operations " (page 1) for more information.

Primary Key

Select this checkbox to set the attribute to be a part of
primary key.

Not Null

Select this checkbox to set the attribute Not Null.
See "NotNull Property for PK and AK Attributes" (page
118) for more information.

Unique

Select this checkbox to set the attribute as unique.
See "Unique AttributesToad Data Modeler creates new
alternate keys for unique attributes automatically.
Example: There are two attributes in the T_GENRE
entity.No alternate key exists in this entity.Edit the
Name attribute and select the Unique checkbox.New
alternate key has been added to the entity
automatically. " (page 1) for more information.

Data Type

Data Type selection box
Tips:
l

Before you create new attributes, set up a default
data type, including parameters, for particular
database. See the Settings menu | Options |
Physical Model | particular database version |
Default Data Type combo-box. (The selected
data type will be applied also for Dictionary

108

Toad Data Modeler User Guide
Projects and Models

Tab/Option

Description
Types and Domains.)
l

Domains

Set up maximal length for display of data types
in the physical ERD. Select Settings | Options |
Graphics | Maximal Number of Characters for
Displayed Data Type.

Domains selection box
Note: It's not possible to assign an attribute a data type
and a domain at the same time. If you select a domain,
data type will be set automatically from the domain.

Default

Default value definition

Default
Rule

Default rule selection

Note: Other options on the General tab vary according to a database
type. Options specific for your database can be found in the Databases
chapter.
Check
Constraints
Tab

On this tab, you can add, edit and delete check
constraints.

Foreign
Keys Tab

Details of a foreign key attribute are listed here.

Entity

Name of parent entity

Relationship

Name of relationship connecting the parent entity and
child entity

Attribute

Name of attribute

Permissions
Tab

On this tab, you can assign a User or User Group
permissions for the selected attribute.

Notes Tab

A tab for notes on the attribute. The text will display in
a pop-up box when you point your mouse cursor at the
attribute name in ER diagram (the Attributes item has to
be selected in Display Level).

Not Null
Constraint
Tab

Options related to Not Null Constraint definition.

109

Toad Data Modeler User Guide

110

Projects and Models

Tab/Option

Description
Above the Object Navigator Box, you can see name of
entity that the attribute belongs to. Click the button on
top right-hand corner to open the parent form (Entity
Properties form).

Related Topics
Inplace Editor (page 46)
Object Navigator Box (page 402)
Features (page 374)
Assign a Key to Attribute (page 118)
Display Attributes in Model
To display attributes in your ER diagram
»

From the Display Level box on the toolbar, select Attributes.

To define a display level for particular Workspace
»

Right-click the work area | Workspace Format... | Entities tab | Display Level | select
Attributes.
Note: To set a display level for particular entity, right-click the entity and select
Format (follow the same steps as above).

To set the default Display Level properties for all models that you will create
»

Select Settings | Options | Physical Model | Entity tab | Display Level.

To define different colors for attributes on your Workspace
»

Select Settings | Options | Model section | Physical Model | Entity tab | Attribute
Colors area.

Toad Data Modeler User Guide

111

Projects and Models

Order Attributes
In the Entity Properties form | Attributes tab, you can order attributes:
l

Manually via the green arrows at the bottom of the form

l

Automatically (e.g. by Name, Caption, Data type etc.)

Manual Order
The order you will set via the green arrows will be applied in particular entity box in
the Designer.
Example: Attributes in the Film Entity Properties form have been ordered manually using the
green arrows and finally confirmed Apply. Now see the Film entity in Designer and compare its
order of attributes with the order set in the Film Entity Properties form. The order is identical.
Tip: Hold down the green arrow button to move the selected attribute(s) to a more
distant position.

Toad Data Modeler User Guide

112

Projects and Models

Automatic Order
Click the appropriate column name - e.g. click the Name column to sort attributes alphabetically.
This function offers you just a different view on the attributes in the Entity Properties form.
It does not influence order of attributes in entity box in the Designer.
If you sort attributes this way, you cannot manually change order of attributes via the green
arrows. If you click a green arrow, this message will display:

Click OK to activate the green arrows and order the attributes manually.
Notes:
1. No green arrow is enabled when there is no attribute or when there are attributes but none
is selected.
2. If any sorting function is turned on (e.g. sorting by name), green arrows are both active, so
you can click any of them to turn off the sorting and set the ordinal order.

Copy Attributes
In Toad Data Modeler there are several methods and places where to copy attributes. You can
select from the following options.

A. CTRL + Drag&Drop techniques on the Workspace
Use: This way, you can copy attributes within an entity and between entities on one WS. You
can copy one or more attributes at one jump.
Example:
1. Display attributes in your model. See "Display Attributes in Model" (page 110) for more
information.
2. Select an entity of which attributes you want to copy.

Toad Data Modeler User Guide

113

Projects and Models

3. Press CTRL and hold the key down. Click the attributes that you want to copy.
4. Release CTRL key.

5. Now click the selected objects, hold the mouse button down. Press CTRL again and hold
the key down.
6. Drag the selected attributes to a target entity. (If you want to copy the attributes within
the entity, drag it a little in the entity box itself.)
7. Release your mouse button and CTRL.

B. In the Entity Properties form | Attributes tab:
CTRL + Drag&Drop techniques
Use:
l

In the Entity Properties form, you can copy attributes within an entity and between
entities of the same model or a different model.

l

From the Entity Properties form and Workspace, and vice versa

l

Between the Entity Properties form and Model Explorer

l

Multiple selection is possible here - use SHIFT or CTRL keys

Example:
1. Open the Customer Properties form of the Customer entity and the Employee Properties
form of the Employee entity.
2. Click the Attributes tabs in both forms.
3. Press CTRL and hold the key down.
4. Click the Name attribute in the Customer Properties form and drag it to the Employee
Properties form | Attributes tab.
5. Release your mouse button and CTRL.

Toad Data Modeler User Guide

114

Projects and Models

C. In Model Explorer
Use: You can make copies of attributes:
l

In Model Explorer itself

l

From Model Explorer to a Workspace and vice versa

l

Between Model Explorer and the Entity Properties form | Attributes tab

l

Between two Model Explorers of two different models (see the following examples)

l

Multiple selection is possible here - use SHIFT or CTRL keys

Example: Making a copy of attributes from Model Explorer to a WS.
1. Unfold the Entities folder | 'EntityName' | Attributes tab in Model Explorer tree.
2. Make selection of attributes.
3. Press CTRL, hold it down.
4. Click any selected attribute and drag the attribute to the appropriate entity box on
the Workspace.
5. Release the mouse button and CTRL.

Other Notes
l

An attribute is copied with all its properties.

l

It's possible to copy objects between models of a different database. However, some
specific object properties cannot be copied - properties that are in the source model but
do not exist in target model. E.g. Copy of entity from MS SQL 2005 to MySQL 5.1. Entity A has Partition Schema, Entity B has Fulltext Catalog. In these cases, the entities
will not be copied to MySQL model.

Related Topics
Buttons: (page 93)
Model Explorer (page 391)
Move Attributes
In Toad Data Modeler there are several methods how to move attributes. You can select from the
following options.

A. Drag&Drop techniques on the Workspace
Use: This way, you can move one or more attributes to another entity at one jump.

Toad Data Modeler User Guide

115

Projects and Models

Example:
1. Display attributes in your model.
2. Select an entity of which attribute/attributes you want to move.
3. Press CTRL and hold the key down. Click the attributes that you want to move.
4. Release CTRL.
5. Drag the selected attributes to a target entity.

B. In Entity Properties Form | Attributes tab:
Drag&Drop techniques
Use:
l

In the Entity Properties form, you can move attributes within an entity and between
entities. (To change order of attributes within an entity, use the green arrows.)

l

From the Entity Properties form to a Workspace, and vice versa

l

Between the Entity Properties form and Model Explorer

l

Multiple selection is possible - use SHIFT or CTRL keys

Example:
1. Open the Customer Properties form of the Customer entity and the Employee Properties
form of the Employee entity.
2. Click the Attributes tabs in both forms.
3. Select attributes in the Customer Properties form and drag them to the Employee
Properties form | Attributes tab.

C. In Model Explorer
Use: You can move attributes:
l

Between entities in Model Explorer itself

l

From Model Explorer to an entity on the Workspace directly

l

Between Model Explorer and the Entity Properties form | Attributes tab

l

Between two Model Explorers of two different models

l

Multiple selection is possible - use SHIFT or CTRL keys

Toad Data Modeler User Guide

116

Projects and Models

Tip: Use CTRL to select attributes of various entities in Model Explorer, and move them at one
jump to another entity (of the same model or even a different model).
Example: Moving an attribute in Model Explorer.
1. Unfold the Entities folder in Model Explorer tree.
2. Select attributes (SHIFT or CTRL) and drag them to the Attributes or 'EntityName' folder
of another entity.

Related Topics
Buttons: (page 93)
Model Explorer (page 391)
Delete Attributes
»

In the Entity Properties form | Attributes tab, select the attribute and click Delete.
or
Find the attribute in Model Explorer | EntityName folder | Attributes | right-click
and select Delete Item.
Tip: Use SHIFT or CTRL keys for multiple selection of attributes to delete them.

Keys
Display Keys in Model
To display keys in your ER diagram
»

From the Display Level box on the toolbar, select Primary Keys or PK and FK Keys or
All Keys.

To define a display level for particular Workspace
»

Right-click the work area | Workspace Format | Entity tab | Display Level.
Note: To set a display level for particular entity, right-click the entity and select
Format (follow the same steps as above).

Toad Data Modeler User Guide

117

Projects and Models

To display keys graphically in your ER diagram
»

Right-click the work area | Workspace Format | Entity tab | select the Display Keys
Graphically checkbox.

To define different colors for key attributes on your Workspace
»

Select Settings | Options | Model section | Physical Model | Entity tab | Attribute
Colors area.

To highlight key attributes on your Workspace
»

Point your cursor at a relationship line.
Tip: When you point your mouse cursor at a relationship line, parent and child
attributes are highlighted on the Workspace. You can set up the color at: Settings |
Options | Graphics | Colors area | Highlight Color.

Primary Key and Alternate Keys
Create Keys
An entity can have a primary key and many alternate keys. These keys are stored on the Keys
tab in the Entity Properties form.
To create a new key, select any from the following options:
»

In the Entity Properties form | Keys tab | click Add.
or
Model Explorer | Entities | EntityName folder | right-click the Keys item |
select Add Key.

Notes:

Toad Data Modeler User Guide

118

Projects and Models

1. There is one primary key created by default in every entity (the key is empty).
2. Primary keys are graphically marked by red key by default.

3. It's not possible to delete a primary key. However, it can remain empty.
4. A primary key can be added to more attributes.

Assign a Key to Attribute
You can assign a key to attributes in the Entity Properties form on tabs:
l

Attributes
or

l

Keys

To assign a key on tab Attributes
»

Double-click the space in the Key column next to the selected attribute. Take notice of
the order of attributes you select for the primary key.

To assign a key on tab Keys
1. Double-click the key or select the key and click Edit.
2. In the Key Properties dialog, define the key properties on tab General.
3. Click the Attributes tab and select an attribute (attributes). (Use SHIFT or CTRL for
multiple selection.)

4. Click

to shift the selected attribute(s) to the section Selected.

NotNull Property for PK and AK Attributes
Toad Data Modeler allows you to select/clear the NotNull property for PK and AK attributes.
You have this possibility only if the Allow Null Attributes in Keys checkbox is selected (it is
clear by default).

Toad Data Modeler User Guide

119

Projects and Models

To select this checkbox
»

Select Settings | Options | Physical Model and select the checkbox.

If this checkbox is not selected, Toad Data Modeler doesn’t allow you to clear the NotNull
checkbox in key attributes.
The availability of this option differs by database:
Database

Allow NULL in PK

Allow NULL in AK

DB2 z/OS v. 9

n/a

n/a

DB2

n/a

n/a

available

available

MS SQL Azure

n/a

available

MS SQL Server 2000

n/a

n/a

MS SQL Server 2005

n/a

available

MS SQL Server 2008

n/a

available

MySQL

n/a

available

Oracle

available

available

PostgreSQL

n/a

available

Sybase ASE

n/a

n/a

Sybase SQL Anywhere

n/a

n/a

MS Access

If the Allow Null Attributes in Keys checkbox is selected, it works this way:
l

If you assign an attribute to the key (PK, AK), the Not Null checkbox of the
attribute will be selected. (However, it will not be disabled and you will be able to
change the property.)

l

During propagation of the key via the identifying relationship, Not Null property is taken
from parent attribute to child attribute. The only exception is the case when the database
doesn't support Null value in primary key and it would be created via the propagation.

l

During model conversion, the changed settings of the Not Null property are taken into
consideration for particular attribute and particular database (see the table above).

l

For databases that support Null value in child attribute, the Mandatory Parent checkbox
is selected in the Relationship Properties dialog and should behave coherently to Null
value in child attribute as well as it behaves for non-identifying relationships.

Toad Data Modeler User Guide

120

Projects and Models

l

For databases that support Null value in child attribute, the settings of the Synchronize
NotNull with Mandatory Parent option work the same way for PFK as for FK.
See "Synchronization of NotNull and Mandatory Parent" (page 127) for more information.

Related Topics
Synchronization of NotNull and Mandatory Parent (page 127)
PER - LER Conversion Information (page 428)
Edit Keys
»

In the Entity Properties dialog | Keys tab | double-click the key.
or
Find the key in Model Explorer | EntityName folder | Keys | Double-click (or
right-click it and select Edit).

Option

Description

General Tab

Description

Caption

Logical key name

Name

Physical key name
Opens the Application Variables form.

Note: Other options on the General tab vary according to a database
type. Options specific for your database can be found in the "Databases"
chapter.

Attributes
Tab

Description

Available

A list of all attributes of the entity

Selected

Attribute(s) that have been assigned the key.
Adds selected item(s).
Tip! - For multiple selection of attributes, use SHIFT or
CTRL.

Toad Data Modeler User Guide
Projects and Models

Puts back selected item(s).

Adds all items.

Puts back all items.
Notes Tab

A tab for notes on the key.

Using
Index
Properties
Tab

Definition of other Key properties.

Delete Keys
»

In the Entity Properties form | Keys tab, select the key and click Delete.
or
Find the key in Model Explorer | EntityName folder | Keys | right-click the key
and select Delete Item.
It's not possible to delete a primary key. However, it can remain empty. It's not
possible to delete an alternate key of unique attribute either.

Select Parent Key for Relationship

Linking Method
In Toad Data Modeler, you can link parent and child entities:
l

Through a Key (Primary or Alternate key) of parent entity

l

Through Unique Index of parent entity

To set up a linking method
1. Double-click the selected relationship.
2. From the Parent Key box, select the appropriate linking method.

121

Toad Data Modeler User Guide
Projects and Models

Related Topics
PER - LER Conversion Information (page 428)
Unique Attributes
Toad Data Modeler creates new alternate keys for unique attributes automatically.
Example: There are two attributes in the T_GENRE entity.

122

Toad Data Modeler User Guide
Projects and Models

No alternate key exists in this entity.

123

Toad Data Modeler User Guide
Projects and Models

Edit the Name attribute and select the Unique checkbox.

124

Toad Data Modeler User Guide
Projects and Models

New alternate key has been added to the entity automatically.

125

Toad Data Modeler User Guide

126

Projects and Models

Foreign Keys
Foreign Keys in Toad Data Modeler
As soon as you create a relationship in Toad Data Modeler, foreign keys are created
automatically in the child entity (automatic key migration).
There are two types of foreign keys:
l

Foreign keys (FK, graphically marked by green key by default)

l

Primary Foreign keys (PFK, graphically marked by blue key by default)

The type of FK depends on what relationship you create. (See "Identifying Relationship" (page
160) for more information.

Toad Data Modeler User Guide

127

Projects and Models

See "Identifying Relationship" (page 160) for more information

Synchronization of NotNull and Mandatory Parent
»

Select Settings | Options | Physical Model | General tab | Synchronize Not Null with
Mandatory Parent.

By default, this checkbox is selected. You can change the settings during your modeling, the
new settings will be used straight away for items that you will create in your model.
l

Synchronization enabled: If cardinality is set Mandatory Parent, the FK attribute will be
automatically Not Null. If you clear the Not Null checkbox of the FK attribute,
Mandatory Parent changes to optional.

l

Synchronization disabled: If you clear the Not Null checkbox of the FK attribute, the
cardinality of Mandatory Parent will remain unchanged.

Foreign Keys in the Attribute Properties Dialog
If you open the Attribute Properties dialog | Foreign Keys tab, you can see details on particular
foreign key:
l

Name of the parent entity

l

Name of relationship connecting the parent and child entity

l

Name of PK Attribute

Toad Data Modeler User Guide

128

Projects and Models

Foreign Keys in the Relationship Properties Dialog
In the Relationship Properties dialog | Foreign Keys tab, you can set up a linking method
between parent and child entities.
See "Linking Method " (page 121) for more information

Related Topics
NotNull Property for PK and AK Attributes (page 118)
Buttons: (page 168)
PER - LER Conversion Information (page 428)
FK Mapping
In Toad Data Modeler, you can control your foreign keys. Foreign keys mapping feature allows
you to create Compound Keys, use existing keys etc.
Example:
In the Genre entity, there is a Genre ID attribute (primary key), and in the Film entity the Genre
ID attribute exists too.

If you create a new relationship between the two entities, a new foreign key will be created
automatically.

Toad Data Modeler User Guide
Projects and Models

Solution: Map the newly created foreign key:
1. Double-click the Is of relationship to edit it.
2. Click the Genre ID item in the Child column to expand the combo-box with other
attributes of the child entity.

4. Select the first Genre ID item and confirm OK.
5. Result: There is only one Genre FK in the Film attribute.

129

Toad Data Modeler User Guide

130

Projects and Models

Tip: To restore the original foreign key later, edit the relationship again | Foreign Keys tab and
select the item 'FK attribute (New)'.

Automatic FK Mapping
You can also set Automatic FK Mapping in Settings | Options | Model | Physical Model.

Toad Data Modeler User Guide

131

Projects and Models

l

Disable—FK mapping is OFF

l

Enable—Toad Data Modeler searches for matching attributes. If a single option is found,
it gets mapped. If multiple options are found, a dialog appears.

l

Always Show Dialog—The dialog opens even if only a single option is found.

Indexes
Indexes
To create an index
»

In the Entity Properties form, select the Indexes tab and click Add.
Tip: You can also create indexes in Model Explorer | Entities folder | Unfold the
selected entity | Right-click the Indexes item. | Add Index.

To edit indexes
»

In the Entity Properties dialog | Indexes tab, double-click the index or press Edit.
Tip: You can also edit/rename/delete indexes in Model Explorer | EntityName
folder | Indexes | Right-click it the selected index.

Option

Description
Above the Object Navigator Box, you can see name
of entity that the index belongs to. Click the button
on top right- hand corner to display parent form

Toad Data Modeler User Guide
Projects and Models

Option

Description
(Entity Properties form).

Object
Navigator box

All Indexes of selected entity are listed here. The
combo- box allows you to edit them quickly and
comfortably from one place. Click Apply to confirm
the changes so as the dialog remains opened for other
edit.

General Tab

Description

Caption

Logical index name

Name

Physical index name

Schema

Schema box selection

Unique

Select this option to set the index as unique. Via
unique indexes, you can link entities together. See
"Linking Method " (page 121) for more information
on available linking methods.

Bitmap Index

Database dependent item (Oracle). Select this
checkbox to define the index as bitmap index.

Generate

Select it to generate the index in final SQL (DDL)
script. (It is selected by default.)

Note: Other options on the General tab vary according to a database
type. Options specific for your database can be found in the "Databases"
chapter.
Items Tab

Description

Available

A list of all attributes of the entity.

Selected

Attribute(s) that have been assigned to the index.

Notes Tab

Tab for notes on the index.

Index
Properties
Tab

Description

Tablespace

Select a tablespace or click the button on the right to
define a new tablespace.

132

Toad Data Modeler User Guide

133

Projects and Models

Indextype

Index type definition

ODCI
Parameters

ODCI parameters definition

To display indexes on the Workspace
»

Right-click the WS, select Workspace Format | Entity tab and select the Display
Indexes checkbox.

See how indexes are displayed:

Note: No matter if indexes are displayed or not, you can see which attribute belongs to
which index (see e.g. attribute Name belonging to indexes i_name and i_name_address name (IX1,IX2).
To delete an index
»

In the Entity Properties dialog | select the Indexes tab, select the index and click Delete.

Check Constraints
Check Constraints
Check constraints can be created on tab Check Constraints in the Entity Properties form (for
multiple column check constraints) or Check Constraints on the Attribute Properties dialog
(single column check constraint).
To add a check constraint
»

In the Entity Properties form, select the Check Constraints tab and click Add.
Tip: You can also add a constraint in the Model Explorer | Entities folder |
Unfold the selected entity. | Right-click the Check Constraints item. | Add Check
Constraint.

To edit a check constraint
»

In the Entity Properties form | Check Constraints tab, double-click the selected check
constraint or press Edit .
Tip: You can also edit/rename/delete check constraints in Model Explorer |

Toad Data Modeler User Guide

134

Projects and Models

EntityName folder | Check Constraints | Right-click the selected check constraint.
General Tab

Description

Caption

Logical check constraint name

Name

Physical check constraint name

Check
Constraint
Rule

Select rule or click the button on the right to define a
new rule.

Generate

Select it to generate the check constraint in final SQL
(DDL) script. (It is selected by default.)

Note: Other options on the General tab vary according to a database
type. Options specific for your database can be found in the "Databases"
chapter.
SQL Tab

Write SQL script for the check constraint here.
See "Templates" (page 473) for more information.
Toad Data Modeler v. 3.5.x changes: Application
Variables %ColumnName% and %TableName%
that you could use on tab SQL of Check
Constraints and Check Constraint Rules must be
written in a new format: <%ColumnName%> and
<%TableName%>.
Old models will be automatically converted to
this new format during the model open.

Notes Tab

Tab for notes on the check constraint.

Tips:
l

To copy a check constraint, CTRL + Drag&Drop techniques on the Check Constraints
tab (folder) of a target entity (in Model Explorer).

l

To move a check constraint, use Drag&Drop techniques on the Check Constraints tab
(folder) of a target entity (in Model Explorer).

l

To delete a check constraint, select the check constraint and click Delete on the Check
Constraints tab in the Entity Properties form.

Toad Data Modeler User Guide

135

Projects and Models

Triggers
Triggers
To add a trigger
»

In the Entity Properties form, select the Triggers tab and click Add.
Tip: You can also add a trigger in the Model Explorer | Entities folder | Unfold
the selected entity. | Right-click the Triggers item. | Add Trigger.

To edit a trigger
»

In the Entity Properties form | Triggers tab, double-click the selected trigger or
press Edit.
Tip: You can also edit/rename/delete triggers in Model Explorer | EntityName
folder | Triggers | Right-click the selected trigger.

Example: The Trigger Properties dialog (Oracle 10g db)

Toad Data Modeler User Guide
Projects and Models

Option

Description
Above the Object Navigator Box, you can see name of
entity that the trigger belongs to. If you click the button
on top right-hand corner, parent form will open (Entity
Properties form).

General
Tab

Description

Caption

Logical trigger name

Name

Physical trigger name

Schema

Schema selection box

Trigger Fire

Before, After (database dependent) - select a trigger fire.

Trigger
Events

Delete, Insert, Update - select a trigger event.

Generate

Select it to generate the trigger in final SQL (DDL)
script. (It is selected by default.)

Generate
SQL Only

Select it to generate only the SQL code written on tab
SQL in final DDL script.

Note: Other options on the General tab vary according to a database
type. Options specific for your database can be found in the "Databases"
chapter.
SQL Tab

Write SQL script for the trigger here.
See "Templates" (page 473) for more information.

Notes Tab

Tab for notes on the trigger.

Example: Trigger Properties dialog | SQL tab (Oracle 10g db)

136

Toad Data Modeler User Guide

137

Projects and Models

Tips:
l

To copy a trigger, CTRL + Drag&Drop techniques on the Triggers tab (folder) of a target
entity (in Model Explorer).

l

To move a trigger, use Drag&Drop techniques on the Triggers tab (folder) of a target
entity (in Model Explorer).

l

To delete a trigger, select the trigger and click Delete on the Triggers tab in the Entity
Properties form.

Permissions
Permissions
In Toad Data Modeler, you can assign permissions to the following objects: Entity, Attribute,
User Data Type, View, Procedure, Schema, Users and User Groups.
A list of permitted objects varies according to a database type. E.g. in some databases, it's not
possible to assign a permission for Users.

Toad Data Modeler User Guide

138

Projects and Models

For every object, different permissions can be set (SELECT, INSERT, UPDATE etc.), depending
on selected database.
Options for permissions are described in the following example of permissions for entity.
Permissions for attribute, user data type etc. are set in the Properties dialog of particular object |
Permissions tab.

Add Permissions
To be able to add a Permission, it's necessary to define a User or User Group. If you forget to
define them first, never mind. Toad Data Modeler allows you to define them directly on tab
Permissions of the appropriate object - click Users or User Groups.
To add a permission for entity
»

In the Entity Properties form, select the Permissions tab and click Add.
Tip: You can also add a permission in the Model Explorer | Entities folder |
Unfold the selected entity. | Right-click the Permissions item. | Add Permission

User or User Group must exist to be able to add a permission.
Example: Created permission in the Entity Properties form:

After you add a new permission and confirm Apply, a new item (user or user group) will display
(e.g. Dave).
If you want to add the created permission to another user or user group, press F2 and select
appropriate user or user group from the User (User Group) box.
Define items in other columns in the same way (F2 or via inplace editor) - Grantor,
SELECT etc.
Permissions

Description

Toad Data Modeler User Guide

139

Projects and Models

Tab
User (User
Group)

Name of user (group) that the permission has been
assigned to.

Grantor

Name of user (group) that has assigned a user (group)
the permission.

Permissions: SELECT, INSERT, UPDATE, DELETE, RULE,
REFERENCES, TRIGGER
To edit a permission
»

In the Entity Properties form | Permissions  tab, double-click the selected permission or
press Edit .

Tip: You can also edit/rename/delete permissions in Model Explorer | EntityName folder |
Permissions | Right-click the selected permission.
General
Tab

Description

Permissions

List of all available permissions to particular object.

Status

Shows if the particular permission has been assigned or
not.
Unchanged - No change has been made.
Grant - Permission has been granted.
Deny - Permission has been denied. (E.g. in MS SQL
2005 models.)

with Grant
Option

Yes/No - Says if the permission can be assigned also to
another user (group).

Tip: To delete a permission, in the Entity Properties form | Permissions tab, select the
permission and click Delete.

Related Topics
Method A - via the Users dialog (page 200)
User Groups (page 202)
PER - PER Conversion Information (page 425)

Toad Data Modeler User Guide

140

Projects and Models

Data Types and Dictionary
Supported Data Types
To display a list of data types supported in Toad Data Modeler
»

Select Model | Model Items |Data Types.

Related Topics
Data Type Conversion Settings (page 422)
PER - PER Conversion Information (page 425)
User Data Types (page 141)
Dictionary TypesIn Toad Data Modeler, you can define dictionary types. Dictionary is an alias
of data type (must be supported by database).Note: In Oracle db, only user data types are used.
Nevertheless, in MS SQL db, user data types and also dictionary types are used.To add a
dictionary typeSelect Model | Dictionary Types and click Add in the Dictionary Types dialog.
Tip: You can also add a dictionary type in the Model Explorer | Right-click the Dictionary
Types folder and select Add Dictionary Type.To edit a dictionary typeSelect Model | Dictionary
Types and double-click the selected dictionary type or click Edit in the Dictionary Types
dialog.Tip: You can also edit/rename/delete dictionary types in Model Explorer |Dictionary
Types folder | Right-click the selected dictionary type.General TabDescriptionCaption Logical
dictionary type nameNamePhysical dictionary type nameData TypeData Type selection
boxNotes: Other options on the General tab vary according to a database type. Options specific
for your database can be found in the "Databases" chapter.All changes you make for selected
dictionary type will be automatically applied in all attributes with this dictionary type.To Do
TabOn this tab, you can write some tasks on the selected dictionary type. Note: To see all To
Do tasks, select Model | To Do. Used In TabAll attributes with this dictionary type are listed on
this tab.In the Name column, there are names of the entity and attribute with this dictionary type.
Double-click it to open the Attribute Properties dialog.Notes TabTab for notes on the dictionary
type.To select a dictionary type for attributesOpen the Attribute Properties dialog of the selected
attribute | General tab.From the Data Type box, select the required dictionary type. Tips:You
can reach the Dictionary Types dialog also from the Attribute Properties dialog - see the small
icons next to the Data Type box.Click OK+Add in the Dictionary Type Properties dialog to
create another dictionary type.To copy dictionary types, use CTRL + Drag&Drop techniques.To
move dictionary types, use Drag&Drop techniques.You can copy and move your dictionary
types within a model and between models of the same and different databases:In Dictionary
Types dialog (Model menu)In Model Explorer | Dictionary Types folderBetween Model Explorer
and Dictionary Types dialogTo delete dictionary types, select:Model | Dictionary Types | Select
a dictionary type and click Delete.Model Explorer | Dictionary Types folder | Right-click and
select Delete Item.Notification! - Deleted dictionary type will be removed from all attributes that
had this dictionary type. In these attributes, first available data type from the Data Type list will
be selected. To find out which attributes they are, you should open the Dictionary Type
Properties dialog | Used in tab before you delete the dictionary type. If you delete the dictionary

Toad Data Modeler User Guide

141

Projects and Models

type by mistake, you can use Undo. Related TopicsUser Data TypesDomainsEdit
AttributesExport/Import Dictionary (page 1)
Domains (page 149)
User Data Types
In Toad Data Modeler, you can define your own data types (only provided that they are
supported in the database you use).
To add a user data type
»

Select Model | Model Items | User Data Types and click Add in the User Data
Types dialog.
Tip: You can also add a user data type in the Model Explorer | Right-click the
User Data Types folder and select Add User Data Type.

Example: User Data Types listed in User Data Types dialog (Model menu)

To edit a user data type
»

Select Model | User Data Types and double-click the selected data type or click Edit in
the User Data Types dialog.
Tip: You can also edit/rename/delete user data types in Model Explorer |User
Data Types folder | Right-click the selected user data type.

Example: The User Data Type Properties dialog (Oracle 10g)

Toad Data Modeler User Guide
Projects and Models

General
Tab

Description

Caption

Logical user data type name

Name

Physical user data type name

Schema

Schema selection box

Type

This option is available for Oracle models only. Select

142

Toad Data Modeler User Guide
Projects and Models

object type here:
Object Type, Varray Type, Nested Table Type.
Note: Most of the options on the General tab vary according to a
database type. Options specific for your database can be found in the
"Databases" chapter.
Generate

Select this option to generate the user data type in final
SQL script.

Generate
SQL Only

This option is available only for Oracle db user data
types.
If this checkbox is selected, only the SQL code that you
manually write on appropriate tab ( Object Type or
Varray Type or Nested Table Type) will be generated
in final DDL script.

Note: All changes you make for selected user data type will be
automatically applied in all attributes with this data type.
To Do Tab

On this tab, you can write some tasks on the selected
user data type.
Note: To see all To Do tasks, select Model | To Do.

Used In
Tab

All attributes with this user data type are listed on this
tab.
In the Name column, there are names of the entity and
attribute with this user data type. Double-click it to open
the Attribute Properties dialog.

Permissions
Tab

On this tab, you can assign a User or User Group
permissions for selected user data type.

Notes Tab

Write notes on particular user data type.

Object
Type Tab

See example of specification and definition in the
following screenshot.

Tip: Click OK+Add to create another user data type.
Example: User Data Type Properties dialog | Object Type tab (Oracle 10g)

143

Toad Data Modeler User Guide

144

Projects and Models

To select a user data types for attributes
1. Open the Attribute Properties dialog of the selected attribute | General tab.
2. From the Data Type box, select the required user data type.
Tip: You can reach the User Data Types dialog from the Attribute Properties dialog - see the
small icons next to the Data Type box.

Toad Data Modeler User Guide

145

Projects and Models

Tips:
1. To copy user data types, use CTRL + Drag&Drop techniques.
2. To move user data types, use Drag&Drop techniques.
You can copy and move your user data types within a model and between models of the
same and different databases:
l

In  User Data Types dialog (Model menu)

l

In Model Explorer | User Data Types folder

l

Between Model Explorer and User Data Types dialog

3. To delete user data types, select:

Toad Data Modeler User Guide

146

Projects and Models

l

Model | User Data Types | Select a user data type and click Delete.

l

Model Explorer | User Data Types folder | Right-click and select
Delete Item.

Notification! - Deleted data type will be removed from all attributes that had this data type.
In these attributes, the deleted user data type will be replaced with a type that it has been
originally created from. To find out which attributes they are, you should open the User
Data Type Properties dialog | Used in tab before you delete the user data type. If you delete
the data type by mistake, you can use Undo.

Related Topics
Dictionary TypesIn Toad Data Modeler, you can define dictionary types. Dictionary is an alias
of data type (must be supported by database).Note: In Oracle db, only user data types are used.
Nevertheless, in MS SQL db, user data types and also dictionary types are used.To add a
dictionary typeSelect Model | Dictionary Types and click Add in the Dictionary Types dialog.
Tip: You can also add a dictionary type in the Model Explorer | Right-click the Dictionary
Types folder and select Add Dictionary Type.To edit a dictionary typeSelect Model | Dictionary
Types and double-click the selected dictionary type or click Edit in the Dictionary Types
dialog.Tip: You can also edit/rename/delete dictionary types in Model Explorer |Dictionary
Types folder | Right-click the selected dictionary type.General TabDescriptionCaption Logical
dictionary type nameNamePhysical dictionary type nameData TypeData Type selection
boxNotes: Other options on the General tab vary according to a database type. Options specific
for your database can be found in the "Databases" chapter.All changes you make for selected
dictionary type will be automatically applied in all attributes with this dictionary type.To Do
TabOn this tab, you can write some tasks on the selected dictionary type. Note: To see all To
Do tasks, select Model | To Do. Used In TabAll attributes with this dictionary type are listed on
this tab.In the Name column, there are names of the entity and attribute with this dictionary type.
Double-click it to open the Attribute Properties dialog.Notes TabTab for notes on the dictionary
type.To select a dictionary type for attributesOpen the Attribute Properties dialog of the selected
attribute | General tab.From the Data Type box, select the required dictionary type. Tips:You
can reach the Dictionary Types dialog also from the Attribute Properties dialog - see the small
icons next to the Data Type box.Click OK+Add in the Dictionary Type Properties dialog to
create another dictionary type.To copy dictionary types, use CTRL + Drag&Drop techniques.To
move dictionary types, use Drag&Drop techniques.You can copy and move your dictionary
types within a model and between models of the same and different databases:In Dictionary
Types dialog (Model menu)In Model Explorer | Dictionary Types folderBetween Model Explorer
and Dictionary Types dialogTo delete dictionary types, select:Model | Dictionary Types | Select
a dictionary type and click Delete.Model Explorer | Dictionary Types folder | Right-click and
select Delete Item.Notification! - Deleted dictionary type will be removed from all attributes that
had this dictionary type. In these attributes, first available data type from the Data Type list will
be selected. To find out which attributes they are, you should open the Dictionary Type
Properties dialog | Used in tab before you delete the dictionary type. If you delete the dictionary
type by mistake, you can use Undo. Related TopicsUser Data TypesDomainsEdit
AttributesExport/Import Dictionary (page 1)
Domains (page 149)

Toad Data Modeler User Guide

147

Projects and Models

Edit Attributes (page 105)
Domains (page 154)
Dictionary Types
In Toad Data Modeler, you can define dictionary types. Dictionary is an alias of data type (must
be supported by database).
Note: In Oracle db, only user data types are used. Nevertheless, in MS SQL db, user data types
and also dictionary types are used.
To add a dictionary type
»

Select Model | Dictionary Types and click Add in the Dictionary Types dialog.
Tip: You can also add a dictionary type in the Model Explorer | Right-click the
Dictionary Types folder and select Add Dictionary Type.

To edit a dictionary type
»

Select Model | Dictionary Types and double-click the selected dictionary type or click
Edit in the Dictionary Types dialog.
Tip: You can also edit/rename/delete dictionary types in Model Explorer
|Dictionary Types folder | Right-click the selected dictionary type.

General
Tab

Description

Caption

Logical dictionary type name

Name

Physical dictionary type name

Data Type

Data Type selection box

Notes:
1. Other options on the General tab vary according to a database
type. Options specific for your database can be found in the
"Databases" chapter.
2. All changes you make for selected dictionary type will be
automatically applied in all attributes with this dictionary type.
To Do Tab

On this tab, you can write some tasks on the selected
dictionary type.
Note: To see all To Do tasks, select Model | To Do.

Used In
Tab

All attributes with this dictionary type are listed on this
tab.

Toad Data Modeler User Guide

148

Projects and Models

In the Name column, there are names of the entity and
attribute with this dictionary type. Double- click it to
open the Attribute Properties dialog.
Tab for notes on the dictionary type.

Notes Tab

To select a dictionary type for attributes
1. Open the Attribute Properties dialog of the selected attribute | General tab.
2. From the Data Type box, select the required dictionary type.
Tips:
1. You can reach the Dictionary Types dialog also from the Attribute Properties dialog see the small icons next to the Data Type box.
2. Click OK+Add in the Dictionary Type Properties dialog to create another
dictionary type.
3. To copy dictionary types, use CTRL + Drag&Drop techniques.
4. To move dictionary types, use Drag&Drop techniques.
You can copy and move your dictionary types within a model and between models of the
same and different databases:
l

In  Dictionary Types dialog (Model menu)

l

In Model Explorer | Dictionary Types folder

l

Between Model Explorer and Dictionary Types dialog

5. To delete dictionary types, select:
l

Model | Dictionary Types | Select a dictionary type and click Delete.

l

Model Explorer | Dictionary Types folder | Right-click and select
Delete Item.

Notification! - Deleted dictionary type will be removed from all attributes that had this
dictionary type. In these attributes, first available data type from the Data Type list will be
selected. To find out which attributes they are, you should open the Dictionary Type
Properties dialog | Used in tab before you delete the dictionary type. If you delete the
dictionary type by mistake, you can use Undo.

Related Topics
User Data Types (page 141)
Domains (page 149)
Edit Attributes (page 105)

Toad Data Modeler User Guide

149

Projects and Models

Domains (page 154)
Domains
Domain is another dictionary item in Toad Data Modeler. Domains have only a logical meaning
and are not generated. If a domain is used in attribute, only values of the domain are transferred
to attribute during the DDL script generation process.
To add a domain
»

Select Model | Model Items |Domains and click Add in the Domains dialog.
Tip: You can also add a domain in the Model Explorer | Right-click the
Domains folder and select Add Domain.

To edit a domain
»

Select Model | Model Items | Domains and double-click the selected domain or click
Edit in theDomains dialog.
Tip: You can also edit/rename/delete domains in Model Explorer |Domains
folder | Right-click the selected domain.

Example: The Domain Properties dialog (Oracle 10g)

Toad Data Modeler User Guide
Projects and Models

General Tab

Description

Caption

Logical domain name

Name

Physical domain name

Data Type

Data Type selection box

Notes:
1. Other options on the General tab vary according to a database
type. Options specific for your database can be found in the
"Databases" chapter.
2. All changes you make for the selected domain will be
automatically applied in all attributes with this domain.
Check

On this tab, you can add, edit and delete check

150

Toad Data Modeler User Guide
Projects and Models

Constraints
Tab

constraints of a domain.

To Do Tab

On this tab, you can write some tasks on the selected
user data type.
Note: To see all To Do tasks, select Model | To Do.

Used In Tab

All attributes with this domain are listed on this tab.
In the Name column, there are names of the entity
and attribute with this domain. Double-click it to
open the Attribute Properties dialog.

Notes Tab

Tab for notes on the domain.

To select domains for attributes
1. Open the Attribute Properties dialog of the selected attribute | General tab.
2. From the Domains box, select the required domain.

151

Toad Data Modeler User Guide

152

Projects and Models

Tips:
1. To copy domains, use CTRL + Drag&Drop techniques.
2. To move domains, use Drag&Drop techniques.
You can copy and move your domains within a model and between models of the same
and different databases:
l

In  Domains dialog (Model menu)

l

In Model Explorer | Domains folder

l

Between Model Explorer and Domains dialog

3. To delete domains, select:
l

Model | Domains | Select a domain and click Delete.

l

Model Explorer | Domains folder | Right-click and select Delete Item.

Toad Data Modeler User Guide

153

Projects and Models

Notification! - The domain will be deleted from all attributes containing it. To find out,
which attributes they are, you should open the Domain Properties dialog | Used in tab
before you delete the domain. If you delete the domain by mistake, you can use Undo.

Related Topics
User Data Types (page 141)
Dictionary TypesIn Toad Data Modeler, you can define dictionary types. Dictionary is an alias
of data type (must be supported by database).Note: In Oracle db, only user data types are used.
Nevertheless, in MS SQL db, user data types and also dictionary types are used.To add a
dictionary typeSelect Model | Dictionary Types and click Add in the Dictionary Types dialog.
Tip: You can also add a dictionary type in the Model Explorer | Right-click the Dictionary
Types folder and select Add Dictionary Type.To edit a dictionary typeSelect Model | Dictionary
Types and double-click the selected dictionary type or click Edit in the Dictionary Types
dialog.Tip: You can also edit/rename/delete dictionary types in Model Explorer |Dictionary
Types folder | Right-click the selected dictionary type.General TabDescriptionCaption Logical
dictionary type nameNamePhysical dictionary type nameData TypeData Type selection
boxNotes: Other options on the General tab vary according to a database type. Options specific
for your database can be found in the "Databases" chapter.All changes you make for selected
dictionary type will be automatically applied in all attributes with this dictionary type.To Do
TabOn this tab, you can write some tasks on the selected dictionary type. Note: To see all To
Do tasks, select Model | To Do. Used In TabAll attributes with this dictionary type are listed on
this tab.In the Name column, there are names of the entity and attribute with this dictionary type.
Double-click it to open the Attribute Properties dialog.Notes TabTab for notes on the dictionary
type.To select a dictionary type for attributesOpen the Attribute Properties dialog of the selected
attribute | General tab.From the Data Type box, select the required dictionary type. Tips:You
can reach the Dictionary Types dialog also from the Attribute Properties dialog - see the small
icons next to the Data Type box.Click OK+Add in the Dictionary Type Properties dialog to
create another dictionary type.To copy dictionary types, use CTRL + Drag&Drop techniques.To
move dictionary types, use Drag&Drop techniques.You can copy and move your dictionary
types within a model and between models of the same and different databases:In Dictionary
Types dialog (Model menu)In Model Explorer | Dictionary Types folderBetween Model Explorer
and Dictionary Types dialogTo delete dictionary types, select:Model | Dictionary Types | Select
a dictionary type and click Delete.Model Explorer | Dictionary Types folder | Right-click and
select Delete Item.Notification! - Deleted dictionary type will be removed from all attributes that
had this dictionary type. In these attributes, first available data type from the Data Type list will
be selected. To find out which attributes they are, you should open the Dictionary Type
Properties dialog | Used in tab before you delete the dictionary type. If you delete the dictionary
type by mistake, you can use Undo. Related TopicsUser Data Types (page 1)Domains (page 1)
Edit Attributes (page 1)Domains (page 1) (page 1)
Edit Attributes (page 105)
Domains (page 154)
PER - LER Conversion Information (page 428)

Toad Data Modeler User Guide

154

Projects and Models

Export/Import Dictionary
Toad Data Modeler allows you to use dictionary items also in other models. You can simply
export all of them to the .TXI file, and then import them to any model at any time. You can save
the .TXI file where you want, no default path is defined.
Dictionary items are:
l

User Data Types

l

Dictionary Types

l

Domains

Domains
They have only a logical meaning. They are not generated in DDL/SQL script. If a domain is
used in attribute, only values of the domain are transferred to the attribute during the DDL script
generation process.

User Data Types
They are data types defined by users and can be generated in final DDL script. User data types
are not derived from data types.

Dictionary Types
They are data types that are derived from other data types. They can be generated in final
DDL script.

How to Export/Import Dictionary
You want to use dictionary items of Model A in Model B:
1. Open Model A in the Application Window.
2. Select Model | Export Dictionary.
3. Save the .txi file.
4. Open Model B in the Application Window.
5. Select Model | Import Dictionary.
6. Select the .txi file and click Open.
Notes:

Toad Data Modeler User Guide

155

Projects and Models

1. Domain Check Constraints are imported/exported too.
2. It's not possible to make selection of the dictionary items for the import/export. All the
dictionary items are always imported/exported at one jump.

Relationships
Notation and Cardinality

IE Notation

Cardinality
One-to-many relationship is represented by this symbol:

Toad Data Modeler User Guide
Projects and Models

One-to-one relationship is represented by this symbol:
Parent: mandatory Child: mandatory

Parent: mandatory Child: optional

Parent: optional Child: mandatory

Parent: optional Child: optional

156

Toad Data Modeler User Guide
Projects and Models

IDF1X Notation

Cardinality

,

,

zero, one or more

one or more
zero or one
Parent: mandatory Child: mandatory

157

Toad Data Modeler User Guide
Projects and Models

Parent: mandatory Child: optional

Parent: optional Child: mandatory

Parent: optional Child: optional

See "Buttons:" (page 168) for more information.

Relationship Types
Identifying Relationship

158

Toad Data Modeler User Guide
Projects and Models

Non-identifying Relationship

Non-identifying Self-relationship

159

Toad Data Modeler User Guide
Projects and Models

M:N Relationship

Related Topics
Identifying Relationship (page 160)
Relationship Types
Toad Data Modeler supports the following relationship types (physical model):
l

Identifying

l

Non-identifying

l

Self-relationship for non-identifying relationship

l

M:N relationship

Identifying Relationship

160

Toad Data Modeler User Guide

161

Projects and Models

Primary key migrates from parent entity to child entity and there becomes a part of the primary
key. It is used when the primary key of the child entity is unable to provide definite
identification.
An entity, connected with a parent entity through an identifying relationship, is called
"dependent" entity and is shown in a model with rounded corners.

The Order Record entity cannot exist itself. It is dependent on entities Customer and Film.
Therefore the Identifying relationship is used. The Order Record entity is a dependent entity, and
the Customer ID and Movie ID items are its unique record identifiers.

Non-Identifying Relationship

Primary key migrates from parent entity to child entity and does not become a part of the primary
key. Non-identifying relationships are represented by dashed lines. In the dependent table, the
attribute is referred to as a foreign key.

The Film ID as the unique identifier for Film is sufficient. Therefore the non-identifying
relationship is used. The Genre ID is only a foreign key. The film can exist without being

Toad Data Modeler User Guide

162

Projects and Models

assigned to a genre, therefore the Film entity is an Independent entity.

Self-Relationship for Non-identifying Relationship

M:N Relationship

-- Table Sup_Price
CREATE TABLE "Sup_Price"(
  "Supplier" Char(10 BYTE) NOT NULL,
  "ArticleID" Integer NOT NULL
)
/
-- Add keys for table Sup_Price
ALTER TABLE "Sup_Price" ADD CONSTRAINT "PK_Sup_Article" PRIMARY KEY
("Supplier","ArticleID")

Toad Data Modeler User Guide

163

Projects and Models

/

Related Topics
Create Relationships (page 211)
Change Type of Relationship
Create Relationships
1. Select a relationship type - click the appropriate relationship icon on the toolbar:
Identifying relationship (also CTRL+R)
Non-identifying relationship
M:N relationship
2. Move your mouse cursor over the work area. (The cursor changes its appearance.)
3. Click the first entity (parent) and then the target entity (child).
Tips:
l

Select a mode for creating relationships - Straight Mode or Right Angled mode.See
"Straight Mode" (page 171) for more information.

l

While creating a relationship, you can add handle points. Click the parent entity and then
click the work area as many times as many handle points you want to create. Finally click
the child entity.

l

Make only horizontal and vertical relationship lines:
1. Select a relationship type and click the parent entity.
2. Press SHIFT and hold the key down. - Now only vertical and horizontal lines will
be offered to you wherever you move your mouse cursor. (Click the work area to
create some handle points.)
3. Finally, click the child entity.

l

Hide relationship names:
1. Right-click the Workspace and select Workspace Format.
2. In the Workspace Format dialog | General tab, clear the Display Line Names
checkbox.

To create self-relationship for non-identifying relationship
1. Click the Non-identifying relationship icon on the toolbar
2. Move your mouse cursor over the work area.

.

Toad Data Modeler User Guide

164

Projects and Models

3. Double-click the selected entity on the Workspace.
Tip: Before you create a self-relationship, select Settings | Options | Physical Model | Self
Relation Attribute Name/Caption and define a name for propagated attributes there (e.g. via
prefix, suffix, application variable.)
To add multiple relationships

1. Press SHIFT and click the Relationship icon. See the blue frame in the icon now.
2. Create as many relationships in you model as you need.
3. Right-click the work area (or click the Relationship icon again) to turn this function off.
Note: This function can be applied for any object on the toolbar.

Related Topics
Buttons: (page 168)
Linking Method (page 121)
Synchronization of NotNull and Mandatory Parent (page 127)
Automatic FK Mapping (page 130)
Features (page 374)
Default Values (page 470)
PER - LER Conversion Information (page 428)
Edit Relationships
»

Double-click the relationship on the Workspace.
or
Edit the relationship in Model Explorer | Relationships folder | double-click the
selected relationship (or right-click | Edit).
Note: You can also edit relationship in the Relationships dialog (Model menu |
Model Items |Relationships | Edit).

Example: The Relationship Properties dialog (Oracle 10g db)

Toad Data Modeler User Guide

165

Projects and Models

Tip: When you point your mouse cursor at a relationship line, parent and child attributes are
highlighted on the Workspace. You can set up the color at: Settings | Options | Graphics |
Colors area | Highlight Color.
Option

Description

Caption

Logical name of relationship

Name

Physical name of relationship
See "Naming ConventionsAbout Naming
ConventionsToad Data Modeler allows you to use
naming conventions in your physical models. What

Toad Data Modeler User Guide
Projects and Models

Option

Description
are naming conventions? Via naming conventions
you can:Define your own rules for physical names of
objects – e.g. add prefix or suffix to the names, use
only lower case etc.Synchronize caption (logical
name) and name (physical name) of objects of your
model.Verify whether the physical names of objects
match the naming convention rules. If they don’t, you
can decide whether to apply them or not.Note:
Naming conventions always influence physical
names, NOT captions. Captions (logical names) can
be in various forms as they provide logical
information only. Naming Conventions in Toad Data
Modeler – Basic InformationNaming conventions are
supported for most objects of physical model for
which you can define a name (physical name) and a
caption (logical name).A naming convention can be
used in various models across different database
systems.You can use them for new models, reversed
models or models that already exist in Toad Data
Modeler.Every defined naming convention is stored
in external .TXN file stored by default in your
Documents folder, directory Toad Data Modeler\
Installation name\Naming Conventions.You can
define only one naming convention for one
model.Toad Data Modeler allows you
to:Automatically create physical names based on
logical names and naming conventions rules.
(Example: Customer ID => T_CUSTOMER_ID). This
feature makes you more productive as you need
significantly less time to define both logical and
physical names.Define valid characters for physical
names and set how invalid characters should be
replaced.Use glossaries for automatic word
replacement during new objects creation. Glossaries
can be made of multiple CSV files and you can easily
turn on or turn off the selected glossaries.Verify
naming conventions and rewrite physical names in a
batch mode. Check your model and replace physical
names of objects that don’t match naming
conventions rules.Synchronize captions and names
(without specific naming convention
definitions).Import/export of glossaries (*.CSV files)
also from/to other tools.See the Naming Convention
Properties dialog | Glossary tab | Import button.You
can find some CSV files with diacritical marks at:

166

Toad Data Modeler User Guide
Projects and Models

Option

Description
formation.

General Tab

Description

Relationship
Type

Select this option to set the relationship as
identifying or non-identifying.

Parent Key

Linking Method selection box. Available options:
primary key, alternate key, unique item.
See "Linking Method " (page 121) for more
information.

Referential
Integrity

See "Referential Integrity" (page 168) for more
information.

Cardinality
Area

Cardinality settings definition.
Toad Data Modeler allows you to set up
synchronization of NotNull and Mandatory Parent.
See "Synchronization of NotNull and Mandatory
Parent" (page 127) for more information.

Settings

Database dependent options (Oracle in our example).

Parent Entity
Name and
Child Entity
Name

Names of entities that the relationship connects.
Click the buttons next to these boxes to open the
Entity Properties form of appropriate entities.

Note: Other options on the General tab vary depending on a target
database. See the specific options for your database in the "Databases"
chapter.
To Do Tab

On this tab, you can write some tasks on the selected
relationship.
Note: To see all To Do tasks, select Model | To Do.

Notes Tab

SQL Preview
Tab

Tab for notes on particular relationship. The text will
display in a pop-up box when you point your mouse
cursor at the relationship name in ER diagram.
Click
at the bottom of this tab to see the part of
SQL code for the relationship.
Select the WordWrap checkbox to wrap the code on
this tab.

167

Toad Data Modeler User Guide

168

Projects and Models

Option

Description
Tip: To select this option by default, select Settings |
Options | Physical Model | General tab | Word
Wrap for SQL Preview.

Index to
Foreign Key
Tab

Additional options related to generated or defined
index for the foreign key (Oracle models).

Buttons:
- opens the Application Variables form
OK - confirms all changes and closes the form
Cancel - cancels the changes you have made, and closes the form
Apply - confirms the changes (The form will remain opened for further edit.)
Help - opens the Help file

Related Topics
Change Type of Relationship
Format Relationship LinesIn Toad Data Modeler, you can change format of a particular
relationship or more relationships at one jump. (Use SHIFT key for multiple selection.)To change
a format of all relationship lines on the WorkspaceRight-click the WS and select Workspace
Format.To change format of the selected relationship(s)Right-click the relationship and select
Format.To change format of the relationship name (caption)Right-click the relationship | Format |
Click Font Settings and define the settings in the Font dialog. Tip: Use the Inplace editor to
change the relationship name in your diagram directly. See Inplace Editor for more
information. Related TopicsFormat ObjectsEdit Relationship Lines (page 1)
Inplace Editor (page 46)
Object Navigator Box (page 402)
Features (page 374)
Referential Integrity
To define integrity rules of a relationship related to changing, adding or deleting a record
inside parent or child entity
»

Set values in Referential Integrity group box.

Toad Data Modeler User Guide
Projects and Models

Option

Description

Parent
Update

An event when the primary key of the record is going to
be changed inside the parent entity. The rules are:
None
No rule.
Restrict
If the primary key is changed inside the parent entity
record, and inside the child entity there are records
allocated to the original parent record primary key, the
change will not be made and database will report an
error.
Cascade

169

Toad Data Modeler User Guide

170

Projects and Models

Option

Description
If the primary key is changed inside the parent entity
record, and inside the child entity there are records
allocated to the original parent record primary key, the
database will change appropriate foreign keys inside the
child entity.
Set NULL
If the primary key is changed inside the parent entity
record, and inside the child entity there are records
allocated to original parent record primary key, the
database will set appropriate foreign keys inside the child
entity to NULL.
Set Default
If the primary key is changed inside the parent entity
record, and inside the child entity there are records
allocated to the original parent record primary key, the
database will set appropriate foreign keys inside the child
entity to a default value.

Parent
Delete

An event when a record inside the parent entity is being
deleted. The rules are:
None
No rule.
Restrict
If a record inside the parent entity is being deleted, and
inside the child entity there are records allocated to
parent entity, the command won't be executed.
Cascade
In case of record deletion inside the parent entity, the
records inside the child entity will be deleted as well.
Set NULL
In case of record deletion inside the parent entity, the
foreign keys inside the child entity will be set to NULL.
Set Default
In case of record deletion inside the parent entity, the
foreign keys inside the child entity will be set to a
default value.

Tip: Define default values for referential integrity type. See "Default Values" (page 470) for more
information.

Toad Data Modeler User Guide

171

Projects and Models

Edit Relationship Lines
In Toad Data Modeler, you can manage relationship lines in two modes:
l

Straight mode

l

Right Angled mode

To set up the default mode for new models and new workspaces of already existing models
»

Select Settings | Options | Physical/Logical Model | tab Workspace, select or clear the
Right Angled Lines checkbox.
Note: In already existing models, you can switch between the modes during
your modeling on Workspaces. (Right-click the Workspace and select
Workspace Format.)

Straight Mode
In the Straight Mode, you can:
l

Add, move, remove and align handle points

l

Switch between straight and right-angled lines

To add handle points on the relationship line
1. Select the relationship.
2. Press CTRL, hold it down and click the relationship line where you want to add the
handle point.
To move a handle point
1. Select the relationship.
2. Point the mouse cursor at the handle point until a small black arrow displays.
3. Drag and drop it.
To remove a handle point
1. Select the relationship.
2. Press CTRL, hold it down and point your mouse cursor at a point you want to remove. ->
The mouse cursor changes to a small black arrow.
3. Click the selected point to remove it.
To align handle points
1. Select the handle points (use ALT key to select a line segment, use SHIFT key to select
more line segments).

Toad Data Modeler User Guide

172

Projects and Models

2. Select Edit | Align. The Align Palette opens.
3. Select the Handle Points icon, which enables only appropriate aligning options.

To change the mode of relationship lines on particular Workspace
»

Right-click the selected Workspace and click Straight All Lines or Change Lines to
Right Angled.

To change the mode of the selected relationship line on the Workspace
»

Right-click the selected relationship line(s) and click Straight Line or Change Line to
Right Angled, or

»

Right-click the selected relationship line(s), select Format | Line tab and select
Force Right Angled Line.

Lock Points in Right Angled Mode—if this option is checked and you move with the end
shape, the line tries to retain all inner points while staying right angled. In other cases, it tries to
produce an optimal right angled line according to Z or L style.
This option is active only if right angled mode for the given Workspace or line is checked.
Force Right Angled Line—enables right angled mode for a single line.
This option is active only if right angled mode is not selected for the given Workspace.

Toad Data Modeler User Guide

173

Projects and Models

Right Angled Mode
In the Right-angled mode:
l

You can add and remove handle points.

l

You cannot move handle points (but can move the selected line segment).

l

You cannot change the right-angled lines to straight lines (but can change the straight
lines to right-angled).

Move Relationship Anchor Points
Relationship automatically links the closest sides of entities. Anchor is always placed in the
middle of the entity box side and it's not possible to alter it.
You can only remove an anchor point from one entity to another or from one entity shortcut to
another. For this purpose, use the drag&drop techniques.

Move Relationship Lines
You can use:
l

Drag&drop techniques

l

Keyboard arrows

Tips:
1. To move an entity with its relationship, including all handle points, select the entity and
the appropriate relationship (use SHIFT) and drag and drop the entity. Result: The
selected entity, relationship and its handle points will move too. Position of handle points
will be preserved.
2. Move only the selected line segment: Press ALT key, hold it down, select the line
segment and move it by the drag and drop techniques or via the keyboard arrows. (This
option works only for angled lines (however, in both Straight and Right-angled modes).)
3. In the Objects menu, see the following options:
Select Links Automatically - Enable this option if you want to select the
relationships of related entities automatically while making the multiple selection
via SHIFT key.
Recalculate on Move - Enable this option if you want to recalculate and see
position of relationships while moving a bloc of objects.

Toad Data Modeler User Guide

174

Projects and Models

Move, Hide, Find Relationship Names
To move the name of relationship on the Workspace
»

Right-click the selected relationship in particular place and select Move Caption
Here, Move Caption to Parent or Move Caption to Child.

To hide relationship names on the Workspace
»

Right-click the Workspace | Workspace Format | General tab | clear the Display Line
Names checkbox.

To find the relationship line by its name on the Workspace
»

Click the relationship name (caption). The appropriate relationship line will be
highlighted on the Workspace by the blue color.

To find the relationship name (caption) by its line on the Workspace
»

Click the relationship line, its name (caption) will be highlighted in a frame.

Multiple Selection/Move of Relationships
Relationships are moved together with selected group of entities. (See "Select Objects Physical
Model Pointer and Objects Selection tool optionsLogical Model Pointer and Objects Selection
tool optionsMetamodel Pointer and Objects Selection tool optionsSelect Links Automatically—
also available from Objects menu. By default enabled. When enabled, lines/relationships
between selected objects are selected automatically. During one selecting process you can enable
and disable this option several times to select only certain lines/relationships. To select multiple
objects on Workspace, you have the following options:Press SHIFT and click the particular
objects on WS. This option works regardless settings in Pointer and Objects Selection tool on
the toolbar.Drag your mouse over the objects on WS. (Works only for adjoining objects.)Note: If
you drag your mouse from the left side, only the objects that are entire in the frame will be
selected. If you drag your mouse from the right side, even objects that are partly in the frame will
be selected. - See the following example.Example:You want to select the Customer and Order
Record entities. In Pointer and Objects Selection tool, you must set either Select All
(relationships will be also selected), Select Entities or Select All Shapes. Drag your mouse from
the left side as long as both entities are completely in the frame (see the following
image).Release your mouse button. Objects have been selected.The result would be the same if
you dragged your mouse from the right side and included even a small part of the two entities in
the frame. Tip: To select all objects on WS, select Edit | Select All. To select more objects on
WS by category or schema/ownerRight-click the Workspace | Select Objects.Define a category or
owner, or category and owner and click Select. To select child and parent objects of the
selected entity on the WorkspaceRight-click the selected entity and select Select Parent Objects
or Select Child Objects or Select Parent and Child Objects.To select multiple objects in Model

Toad Data Modeler User Guide

175

Projects and Models

Explorer and grids (e.g. Entity Properties form)Use SHIFT or CTRL keys. Related TopicsObject
ViewerSearch Objects" (page 1) for more information.
To edit the selected relationships and change their format at one jump, use SHIFT for multiple
selection. Then right-click any selected relationship and select Edit or Format.

Related Topics
Format Relationship LinesIn Toad Data Modeler, you can change format of a particular
relationship or more relationships at one jump. (Use SHIFT key for multiple selection.)To change
a format of all relationship lines on the WorkspaceRight-click the WS and select Workspace
Format.To change format of the selected relationship(s)Right-click the relationship and select
Format.To change format of the relationship name (caption)Right-click the relationship | Format |
Click Font Settings and define the settings in the Font dialog. Tip: Use the Inplace editor to
change the relationship name in your diagram directly. See Inplace Editor for more
information. Related TopicsFormat ObjectsEdit Relationship Lines (page 1)
Format Relationship Lines
In Toad Data Modeler, you can change format of a particular relationship or more relationships at
one jump. (Use SHIFT key for multiple selection.)
To change a format of all relationship lines on the Workspace
»

Right-click the WS and select Workspace Format.

To change format of the selected relationship(s)
»

Right-click the relationship and select Format.

To change format of the relationship name (caption)
»

Right-click the relationship | Format | Click Font Settings and define the settings in the
Font dialog.

Tip: Use the Inplace editor to change the relationship name in your diagram directly. See
"Inplace Editor" (page 46) for more information.

Toad Data Modeler User Guide
Projects and Models

Related Topics
Format Objects (page 62)
Straight Mode (page 171)

176

Toad Data Modeler User Guide
Projects and Models

Relationship Right-Click Options

Option

Description

Format

Opens the Object Format dialog for the selected
relationship.

Add into
Workspace

Opens the Workspaces dialog where you can select a
WS to add the relationship to. (The entities that the
relationship connects will be inserted as well.)

Add into New
Workspace

Creates a new Workspace in the Application Window
and adds the relationship to it (including the entities
that the relationship connects).

Remove from
Workspace

Removes the selected shortcut from particular
Workspace.

177

Toad Data Modeler User Guide
Projects and Models

Option

Description

Delete Object

Deletes the selected relationship from model.

Arrange

Arranges the relationship in another layer.
See "Arrange Objects in Layers" (page 336) for more
information.

Add Object to
Gallery

You can add the relationship in a gallery.

Straight Line

Straights the selected relationship line. (This option is
disabled in the Right Angled mode.)

Change Line
to Right
Angled

Changes the selected straight line to right-angled.

Simplify Line

Reduces the selected line leaving only the necessary
number of handle points and connects the entities in
the shortest possible way. (Straight line will change to
right-angle.)

Reduce
Handle Points

Removes unnecessary handle points (from line
segments of the selected line).

Move Caption
Here

Moves the caption of the relationship to the position
where you pressed the right-click.

Move Caption
to Parent

Moves the caption of the relationship to the parent
table of the relationship.

Move Caption
to Child

Moves the caption of the relationship to the child
table of the relationship.

Edit

Opens the Relationship Properties dialog.

Edit
Entities/Views

There are several predefined patterns. The letter in
symbolizes the shape of the resulting relationship
line:

178

Toad Data Modeler User Guide
Projects and Models

Option

Description
Opens the parent/child Entity Properties form .

Add to
Category

Add the relationship to a current or a new category.

Macros

Provides available macros for relationships.

Views
Views
Toad Data Modeler allows you to display and model views in your ER diagrams visually.

179

Toad Data Modeler User Guide

180

Projects and Models

You can manage Views via:
l

Model menu | Model Items |Views

l

Model Explorer | Views folder

View properties and options are database dependent.
To create a new View
1. Click

on the toolbar and then click the work area.

2. Click
on the toolbar and draw view relationships between some existing table or
view and your newly created view.
3. Double click the view relationship line to edit it. In Alias field you can specify a new
alias name for the linked table.

Toad Data Modeler User Guide

181

Projects and Models

4. Double-click the view to edit it.
5. Define properties on General tab and other tabs.
6. On tab Attributes you can select columns from the linked tables. Relationship aliases and
entities' names are displayed.

Toad Data Modeler User Guide

182

Projects and Models

7. You can use a template on SQL tab of the view.
Note: As well as for entities and relationships, you can create shortcuts of views on the
Workspaces of your model. List of view shortcuts can be found in Model Explorer | in
particular Workspace folder and in the Views folder | Shortcuts.
Related Topics
Copy Objects (page 68)
Move Objects (page 69)
Delete ObjectsIn Toad Data Modeler, there are two deletion options (see the Objects menu):
Remove from Workspace (Delete) - Removes an object shortcut from a Workspace. Delete Object

Toad Data Modeler User Guide

183

Projects and Models

- Deletes an object with all its shortcuts from model.Example:Your model has two Workspaces WS1 and WS2. You add a new entity to your model. -> The entity (its shortcuts) is contained on
both Workspaces (- Auto Complete option is enabled). However, you need to have the new
entity on WS1 only.Solution: You select the entity on the WS2 and simply press Delete. Result:
The entity shortcut in WS2 will be removed. Shortcut in WS1 will remain. The entity still exists
in your model. If you wanted to delete the entity from your model completely (including all its
shortcuts from all Workspaces), you would select the Delete Object option (or press
SHIFT+Delete). For the deletion, you could select any entity shortcut on any WS - either WS1 or
WS2. The entity would be deleted from your model. To remove shortcut of object from
WorkspaceSelect an object (shortcut of object) on the WS and press Delete.Tip: You can delete
shortcuts in Model Explorer too - select particular shortcut of an object in the Shortcuts folder |
right-click | Delete Item.To delete objects from model (including all its shortcuts)Select the
shortcut of object on Workspace and press SHIFT+Delete.Tip: You can also delete the objects:In
Model Explorer - select an object | right-click | Delete Item.In the Object dialog (Model menu |
Model Items | Entities, Relationships etc.) - select the object and click Delete.When you press
Delete or SHIFT+Delete in your ER diagram, the following message will display:Select the
action you want to perform.Note: Key shortcuts: ALT+O for OK and ALT+C for Cancel. To set
the default Delete options in Toad Data Modeler:Select Settings | Options | Dialog Boxes | Other
tab.OptionDescriptionDisplay DialogWhenever you press Delete or SHIFT+Delete in your ER
diagram, the Delete Confirmation Dialog will pop up and you will be able to select what action
you want to perform in particular case.Remove Graphical Representative of ObjectIf this option
is selected, the Delete will always remove selected shortcut(s) of object from particular
Workspace. SHIFT+Delete will have to be used to completely delete an object from your model.
Delete ObjectIf this option is selected, the Delete will completely delete selected object(s) from
your model, including all the object shortcuts. There is no option to only remove selected
shortcut(s) of object. (The Delete will replace SHIFT+Delete.) Related TopicsShortcuts of
Objects (page 1)Select Objects Physical Model Pointer and Objects Selection tool
optionsLogical Model Pointer and Objects Selection tool optionsMetamodel Pointer and Objects
Selection tool optionsSelect Links Automatically—also available from Objects menu. By default
enabled. When enabled, lines/relationships between selected objects are selected automatically.
During one selecting process you can enable and disable this option several times to select only
certain lines/relationships. To select multiple objects on Workspace, you have the following
options:Press SHIFT and click the particular objects on WS. This option works regardless
settings in Pointer and Objects Selection tool on the toolbar.Drag your mouse over the objects
on WS. (Works only for adjoining objects.)Note: If you drag your mouse from the left side, only
the objects that are entire in the frame will be selected. If you drag your mouse from the right
side, even objects that are partly in the frame will be selected. - See the following
example.Example:You want to select the Customer and Order Record entities. In Pointer and
Objects Selection tool, you must set either Select All (relationships will be also selected), Select
Entities or Select All Shapes. Drag your mouse from the left side as long as both entities are
completely in the frame (see the following image).Release your mouse button. Objects have been
selected.The result would be the same if you dragged your mouse from the right side and
included even a small part of the two entities in the frame. Tip: To select all objects on WS,
select Edit | Select All. To select more objects on WS by category or schema/ownerRight-click
the Workspace | Select Objects.Define a category or owner, or category and owner and click
Select. To select child and parent objects of the selected entity on the WorkspaceRight-click
the selected entity and select Select Parent Objects or Select Child Objects or Select Parent and

Toad Data Modeler User Guide

184

Projects and Models

Child Objects.To select multiple objects in Model Explorer and grids (e.g. Entity Properties form)
Use SHIFT or CTRL keys. Related TopicsObject ViewerSearch Objects (page 1) (page 1)

Materialized Views
Materialized Views
Materialized Views are supported in the following databases: Oracle 11g, Oracle 10g and 9i, DB
2 v. 9.5 (LUW), DB 2 v. 9 (LUW), DB2 UDB v. 8 (LUW), Sybase SQL Anywhere 11.
Toad Data Modeler 3.x allows you to display materialized views graphically in your
ER diagram.
To add a materialized view
»

Click

on the toolbar and then click anywhere on the work area.

or
Model Explorer | Right-click the Materialized Views folder | Add
Materialized View.
Tip: Select Model | Model Items |Materialized Views and click Add in the Materialized
Views dialog. Here, you can also view all materialized views of your model.
To edit a materialized view
»

Double-click the materialized view on the Workspace.
or
Edit the materialized view in Model Explorer | Materialized Views folder |
double-click the selected materialized view (or right-click | Edit).

Option

Description

Object
Navigator Box

All materialized views of your model are listed here.
The combo-box allows you to edit them, one by one
from one place. Use Apply to confirm all the changes
you make.

General Tab

Description

Caption

Logical materialized view name

Toad Data Modeler User Guide
Projects and Models

Option

Description

Name

Physical materialized view name

Schema

Schema selection box

Note: Other options are database dependent. See particular database
reference for more information.
Categories

Category selection box

Generate

Select it to generate the materialized view in final
SQL (DDL) script.

Generate SQL
only

Select it to generate only the SQL code written on
tab SQL. The rest of items will be ignored.

SQL Tab

Write SQL code of materialized view subquery on
this tab.
See "Templates" (page 473) for more information.

Permissions
Tab

Here you can assign Users or User Groups
permissions to the materialized view.

To Do Tab

On this tab, you can write some tasks on the selected
materialized view.
Note: To see all To Do tasks, select Model | To Do.

Before Script
Tab

Whatever you write here, it will be generated before
the materialized view definition.

After Script
Tab

Whatever you write here, it will be generated after
the materialized view definition.

Notes Tab

Tab for notes on particular materialized view. The
text written here will display in a pop up dialog
when you point your mouse cursor at the materialized
view shortcut in your ER diagram.

SQL Preview
Tab

Click
at the bottom of this tab to see the part of
SQL code for the materialized view.

Refresh Tab

Use this tab to specify the default methods, modes
and times for the database to refresh the materialized
view.

Physical
Properties
Tab

Define storage characteristics of materialized view on
this tab.

185

Toad Data Modeler User Guide

186

Projects and Models

Option

Description

Materialized
Views
Properties
Tab

Define other materialized view characteristics on this
tab.

Create Index
Tab

Create index sentences are written on this tab.

Related Topics
Copy Objects (page 68)
Move Objects (page 69)
Delete ObjectsIn Toad Data Modeler, there are two deletion options (see the Objects menu):
Remove from Workspace (Delete) - Removes an object shortcut from a Workspace. Delete Object
- Deletes an object with all its shortcuts from model.Example:Your model has two Workspaces WS1 and WS2. You add a new entity to your model. -> The entity (its shortcuts) is contained on
both Workspaces (- Auto Complete option is enabled). However, you need to have the new
entity on WS1 only.Solution: You select the entity on the WS2 and simply press Delete. Result:
The entity shortcut in WS2 will be removed. Shortcut in WS1 will remain. The entity still exists
in your model. If you wanted to delete the entity from your model completely (including all its
shortcuts from all Workspaces), you would select the Delete Object option (or press
SHIFT+Delete). For the deletion, you could select any entity shortcut on any WS - either WS1 or
WS2. The entity would be deleted from your model. To remove shortcut of object from
WorkspaceSelect an object (shortcut of object) on the WS and press Delete.Tip: You can delete
shortcuts in Model Explorer too - select particular shortcut of an object in the Shortcuts folder |
right-click | Delete Item.To delete objects from model (including all its shortcuts)Select the
shortcut of object on Workspace and press SHIFT+Delete.Tip: You can also delete the objects:In
Model Explorer - select an object | right-click | Delete Item.In the Object dialog (Model menu |
Model Items | Entities, Relationships etc.) - select the object and click Delete.When you press
Delete or SHIFT+Delete in your ER diagram, the following message will display:Select the
action you want to perform.Note: Key shortcuts: ALT+O for OK and ALT+C for Cancel. To set
the default Delete options in Toad Data Modeler:Select Settings | Options | Dialog Boxes | Other
tab.OptionDescriptionDisplay DialogWhenever you press Delete or SHIFT+Delete in your ER
diagram, the Delete Confirmation Dialog will pop up and you will be able to select what action
you want to perform in particular case.Remove Graphical Representative of ObjectIf this option
is selected, the Delete will always remove selected shortcut(s) of object from particular
Workspace. SHIFT+Delete will have to be used to completely delete an object from your model.
Delete ObjectIf this option is selected, the Delete will completely delete selected object(s) from
your model, including all the object shortcuts. There is no option to only remove selected
shortcut(s) of object. (The Delete will replace SHIFT+Delete.) Related TopicsShortcuts of
Objects (page 1)Select Objects Physical Model Pointer and Objects Selection tool
optionsLogical Model Pointer and Objects Selection tool optionsMetamodel Pointer and Objects

Toad Data Modeler User Guide

187

Projects and Models

Selection tool optionsSelect Links Automatically—also available from Objects menu. By default
enabled. When enabled, lines/relationships between selected objects are selected automatically.
During one selecting process you can enable and disable this option several times to select only
certain lines/relationships. To select multiple objects on Workspace, you have the following
options:Press SHIFT and click the particular objects on WS. This option works regardless
settings in Pointer and Objects Selection tool on the toolbar.Drag your mouse over the objects
on WS. (Works only for adjoining objects.)Note: If you drag your mouse from the left side, only
the objects that are entire in the frame will be selected. If you drag your mouse from the right
side, even objects that are partly in the frame will be selected. - See the following
example.Example:You want to select the Customer and Order Record entities. In Pointer and
Objects Selection tool, you must set either Select All (relationships will be also selected), Select
Entities or Select All Shapes. Drag your mouse from the left side as long as both entities are
completely in the frame (see the following image).Release your mouse button. Objects have been
selected.The result would be the same if you dragged your mouse from the right side and
included even a small part of the two entities in the frame. Tip: To select all objects on WS,
select Edit | Select All. To select more objects on WS by category or schema/ownerRight-click
the Workspace | Select Objects.Define a category or owner, or category and owner and click
Select. To select child and parent objects of the selected entity on the WorkspaceRight-click
the selected entity and select Select Parent Objects or Select Child Objects or Select Parent and
Child Objects.To select multiple objects in Model Explorer and grids (e.g. Entity Properties form)
Use SHIFT or CTRL keys. Related TopicsObject ViewerSearch Objects (page 1) (page 1)
Procedures
Procedures
To add a procedure
»

Select Model | Procedures and click Add in the StoredProcedures dialog.
Tip: You can also add a procedure in the Model Explorer | Right-click the
Procedures folder | Add Procedure.

To edit a procedure
»

Select Model | Procedures and double-click the selected procedure or click Edit.
Tip: You can also edit/rename/delete procedures in Model Explorer | Procedures
folder | Right-click the selected procedure.

Example: The Procedure Properties dialog (Oracle 10g)

Toad Data Modeler User Guide
Projects and Models

General Tab

Description

Caption

Logical procedure name

Name

Physical procedure name

Schema

Schema selection box

Procedure
Arguments

Define procedure arguments here.

Invoker Rights

Database dependent option. See particular database
reference for more information.

Definition is
Wrapped

Database dependent option. See particular database
reference for more information.

Generate

Select it to generate the procedure in final SQL (DDL)
script.

188

Toad Data Modeler User Guide
Projects and Models

Generate SQL
only

Select it to generate only the SQL code written on tab
SQL. The rest of items will be ignored.

SQL Tab

SQL code. (See the example in the following
screenshot.)
See "Templates" (page 473) for more information.

Permissions
Tab

On this tab, you can manage permissions to particular
procedure.

To Do Tab

Here you can write some tasks on the selected
procedure.
Note: To see all To Do tasks, select Model | To Do.

Before Script
Tab

Whatever you write here, it will be generated before
the Store Procedure definition.

After Script
Tab

Whatever you write here, it will be generated after the
Store Procedure definition.

Notes Tab

Tab for notes on particular procedure.

Example: The Procedure Properties dialog | SQL tab (Oracle 10g)

189

Toad Data Modeler User Guide

190

Projects and Models

Compare Procedures in Sync & Convert Wizard
When the Sync & Convert Wizard shows differences between procedures (on page Select
Items), you can double-click the SQL item of procedures to display details about differences
between them.
Tips:
1. To copy procedures, use CTRL + Drag&Drop techniques.
2. To move procedures, use Drag&Drop techniques.
You can copy and move your procedures within a model and between models of the same
and different databases:
l

In Stored Procedures dialog (Model menu)

l

In Model Explorer | Procedures folder

l

Between Model Explorer and Stored Procedures dialog

3. To delete procedures, select:

Toad Data Modeler User Guide

191

Projects and Models

l

Model | Procedures | Select a procedure and click Delete.

l

Model Explorer | Procedures folder | Right-click and select Delete Item.

Related Topics
Model Explorer (page 391)
Functions
Functions
To add a function
»

Select Model | Model Items |Functions and click Add in the Functions dialog.
Tip: You can also add a function in the Model Explorer | Right-click the
Functions folder | Add Function.

To edit a function
»

Select Model | Model Items | Functions
or click Edit.

and double-click the selected function

Tip: You can also edit/rename/delete functions in Model Explorer | Functions
folder | Right-click the selected function.
Example: The Function Properties dialog (Oracle 10g)

Toad Data Modeler User Guide
Projects and Models

General Tab

Description

Caption

Logical function name

Name

Physical function name

Schema

Schema selection box

Invoker Rights
(CURRENT_
USER)

Database dependent option. See particular database
reference for more information.

Function
Arguments

Write function arguments here.

Datatype of the

Define data type of the return value.

192

Toad Data Modeler User Guide
Projects and Models

Return Value
Deterministic

Database dependent option. See particular database
reference for more information.

Definition is
Wrapped

Database dependent option. See particular database
reference for more information.

Generate

Select it to generate the function in final SQL (DDL)
script.

Generate SQL
only

Select it to generate only the content of the SQL tab.
All other items will be ignored.

SQL Tab

SQL code. (See the example in the following
screenshot.)
See "Templates" (page 473) for more information.

To Do Tab

On this tab, you can write some tasks on the selected
function.
Note: To see all To Do tasks, select Model | To Do.

Permissions
Tab

On this tab, you can assign a User or User Group
permissions for selected function.

Before Script
Tab

Whatever you write here, it will be generated after
the function definition.

After Script
Tab

Whatever you write here, it will be generated before
the function definition.

Notes Tab

Tab for notes on particular function.

Example: The Function Properties dialog | SQL tab (Oracle 10g)

193

Toad Data Modeler User Guide

194

Projects and Models

Tips:
1. To copy functions, use CTRL + Drag&Drop techniques.
2. To move functions, use Drag&Drop techniques.
You can copy and move your functions within a model and between models of the same
and different databases:
l

In  Functions dialog (Model menu)

l

In Model Explorer | Functions folder

l

Between Model Explorer and Functions dialog

3. To delete functions, select:
l

Model | Functions | Select a function and click Delete.

l

Model Explorer | Functions folder | Right-click and select Delete Item.

Toad Data Modeler User Guide

195

Projects and Models

Related Topics
Model Explorer (page 391)
Defaults
Defaults
To add a default
»

Select Model | Model Items |Defaults and click Add in the Defaults dialog.
Tip: You can also add a default in the Model Explorer | Right-click the Defaults
folder | Add Default.

To edit a default
»

Select Model | Model Items | Defaults and double-click the selected default or click Edit.
Tip: You can also edit/rename/delete defaults in Model Explorer | Defaults
folder | Right-click the selected default.

Example: The Default Properties dialog (Oracle 10g)

To select a default for attributes
1. Open the Attribute Properties dialog of the selected attribute | General tab.
2. From the Default Rule box, select a default or write your own default to the Default box.

Toad Data Modeler User Guide

196

Projects and Models

Default box versus Default Rule combo-box
Default box - Set a default for particular attribute.
or
Default Rule - Select a default rule from the combo-box or click the button on the right to
access the Defaults dialog (also accessible via Model menu | Model Items | Defaults). There,
you can define a new default rule. Then, if you want to change the default rule, you can simply
change it via the Defaults dialog. The change will automatically apply in all attributes with
this default rule.
Note: You can define defaults for domains too.
Tips:
1. To copy defaults, use CTRL + Drag&Drop techniques.

Toad Data Modeler User Guide

197

Projects and Models

2. To move defaults, use Drag&Drop techniques.
You can copy and move your defaults within a model and between models of the same
and different databases:
l

In Defaults dialog (Model menu)

l

In Model Explorer | Defaults folder

l

Between Model Explorer and Defaults dialog

3. To delete defaults, select:
l

Model | Model Items | Defaults  | Select a default and click Delete.

l

Model Explorer | Defaults folder | Right-click and select Delete Item.

Related Topics
Model Explorer (page 391)
Templates (page 473)
Check Constraint Rules
Check Constraint Rules
To add a check constraint rule 
»

Select Model | Model Items |Check Constraint Rules and click Add in the Check
Constraint Rules dialog.
Tip: You can also add a check constraint rule in the Model Explorer | Right-click
the Check ConstraintRules folder | Add Check ConstraintRule.

To edit a check constraint rule
»

Select Model | Model Items |Check Constraint Rules and double-click the selected
check constraint rule or click Edit.
Tip: You can also edit/rename/delete check constraint rules in Model Explorer |
Check ConstraintRules folder | Right-click the selected check constraint rule.

To assign a check constraint rule to attribute
1. Edit attribute and click the Check Constraints tab.
2. Add a new check constraint, confirm Apply and click Edit to open its Properties dialog.
3. In the Check Constraint Rule box, select a rule for the attribute.
Note: You can assign rules to attributes and domains.
Tips:

Toad Data Modeler User Guide

198

Projects and Models

1. To copy check constraint rules, use CTRL + Drag&Drop techniques.
2. To move check constraint rules, use Drag&Drop techniques.
You can copy and move your check constraint rules within a model and between models
of the same and different databases:
l

In Check Constraint Rules dialog (Model menu)

l

In Model Explorer | Check Constraint Rules folder

l

Between Model Explorer and Check Constraint Rules dialog

3. To delete check constraint rules, select:
l

Model |Model Items | Check Constraint Rules  | Select a check constraint
rule and click Delete.

l

Model Explorer | Check Constraint Rules folder | Right-click and select
Delete Item.

Related Topics
Model Explorer (page 391)
Schemas
Schemas
To add a schema
»

Select Model | Model Items |Schemas and click Add in the Schemas dialog.
Tip: You can also add a schema in the Model Explorer | Right-click the Schemas
folder | Add Schema.

To edit a schema
»

Select Model |Model Items | Schemasand double-click the selected schema or click Edit.
Tip: You can also edit/rename/delete schemas in Model Explorer | Schemas
folder | Right-click the selected schema.

Related Topics
Schema/Owner/Database Assignment (page 353)

Toad Data Modeler User Guide

199

Projects and Models

Synonyms
Synonyms
To add a synonym
»

Select Model | Model Items |Synonyms and click Add in the Synonyms dialog.
Tip: You can also add a synonym in the Model Explorer | Right-click the
Synonyms folder | Add Synonym.

To edit a synonym
»

Select Model | Model Items |Synonymsand double-click the selected synonym or
click Edit.
Tip: You can also edit/rename/delete synonyms in Model Explorer | Synonyms
folder | Right-click the selected synonym.

Related Topics
Templates (page 473)
Users
Users
Toad Data Modeler allows you to define Users and assign them to User Groups. Later you can
assign the Users and User Groups permissions to particular objects.
To add a user
»

Click

on the toolbar and click Add in the Users dialog.

Note: To open the Users dialog, you can also select Model | Users.
or
In Model Explorer | Right-click the Users folder | Add User.
To edit a user
»

Model | Model Items |Users | double-click the selected user or click Edit.
or
In Model Explorer | Users folder | double-click the selected user or rightclick | Edit.

Toad Data Modeler User Guide

200

Projects and Models

Option

Description

Object
Navigator
Box

All users of your model are listed here. The combo-box
allows you to edit them, one by one from one place. Use
Apply to confirm all the changes you make.

General
Tab

Description

Caption

Logical user name

Name

Physical user name

Password

User's password

Membership
Tab

On this tab, you can assign a User to User Group.
Note: One user can be assigned to more User Groups.
Select a User Group and click appropriate button:
Adds selected item(s).
Puts back selected item(s).
Adds all items.
Puts back all items.
Tip: For multiple selection, use SHIFT or CTRL.

To Do

On this tab, you can write some tasks on particular user.
Note: To see all To Do tasks, select Model | To Do.

To assign users to user groups
Example: All admins should be assigned to user group Administrators.

Method A - via the Users dialog
1. In the Users dialog, select the SCOTT user and click Edit.
2. In the User Properties dialog, click the Membership tab.
3. Select the Administrators user group and click the Add arrow button to shift the selected
group to the window Selected.

Toad Data Modeler User Guide

201

Projects and Models

(The User Groups have already been defined in Model | Model Items |User Groups.)

Tip: If you confirm Apply, the User Properties dialog will remain opened, and you can
comfortably assign other users to user groups. - Simply select another user from the object
navigator box at the top.

Method B - via the User Groups dialog
1. Click

on the toolbar.

2. From the User Groups dialog, select Administrators user group and click Edit.
3. In the User Group Properties dialog, click the Members tab.
4. Select SCOTT and click the Add arrow button to shift the selected user to the
window Selected.
Tips:
1. To copy users, use CTRL + Drag&Drop techniques.
2. To move users, use Drag&Drop techniques.
You can copy and move your users within a model and between models of the same and
different databases:
l

In Users dialog (Model menu)

l

In Model Explorer | Users folder

l

Between Model Explorer and Users dialog

3. To delete users, select:
l

Model |Model Items | Users  | Select a user and click Delete.

l

Model Explorer | Users folder | Right-click and select Delete Item.

Related Topics
User Groups (page 202)
PermissionsIn Toad Data Modeler, you can assign permissions to the following objects: Entity,
Attribute, User Data Type, View, Procedure, Schema, Users and User Groups.A list of permitted
objects varies according to a database type. E.g. in some databases, it's not possible to assign a
permission for Users.For every object, different permissions can be set (SELECT, INSERT,
UPDATE etc.), depending on selected database.Options for permissions are described in the
following example of permissions for entity. Permissions for attribute, user data type etc. are set
in the Properties dialog of particular object | Permissions tab. Add PermissionsTo be able to add
a Permission, it's necessary to define a User or User Group. If you forget to define them first,
never mind. Toad Data Modeler allows you to define them directly on tab Permissions of the
appropriate object - click Users or User Groups. To add a permission for entityIn the Entity

Toad Data Modeler User Guide

202

Projects and Models

Properties form, select the Permissions tab and click Add. Tip: You can also add a permission in
the Model Explorer | Entities folder | Unfold the selected entity. | Right-click the Permissions
item. | Add PermissionUser or User Group must exist to be able to add a permission.Example:
Created permission in the Entity Properties form:After you add a new permission and confirm
Apply, a new item (user or user group) will display (e.g. Dave).If you want to add the created
permission to another user or user group, press F2 and select appropriate user or user group from
the User (User Group) box.Define items in other columns in the same way (F2 or via inplace
editor) - Grantor, SELECT etc.Permissions TabDescriptionUser (User Group)Name of user (group)
that the permission has been assigned to.GrantorName of user (group) that has assigned a user
(group) the permission.Permissions: SELECT, INSERT, UPDATE, DELETE, RULE,
REFERENCES, TRIGGERTo edit a permissionIn the Entity Properties form | Permissions  tab,
double-click the selected permission or press Edit .Tip: You can also edit/rename/delete
permissions in Model Explorer | EntityName folder | Permissions | Right-click the selected
permission.General TabDescriptionPermissionsList of all available permissions to particular
object.StatusShows if the particular permission has been assigned or not.Unchanged - No change
has been made.Grant - Permission has been granted.Deny - Permission has been denied. (E.g. in
MS SQL 2005 models.)with Grant OptionYes/No - Says if the permission can be assigned also to
another user (group). Tip: To delete a permission, in the Entity Properties form | Permissions tab,
select the permission and click Delete. Related TopicsUsersUser GroupsPER - PER Conversion
Information (page 1)
PER - PER Conversion Information (page 425)
User Groups
User Groups
Toad Data Modeler allows you to define Users and assign them to User Groups. Later you can
assign the Users and User Groups permissions to particular objects.
To add a user group
»

Click

on the toolbar and click Add in the User Groups dialog.

Note: To open the User Groups dialog, you can also select Model| User Groups.
or
In Model Explorer | Right-click the User Groups folder | Add User Group.
To edit a user group
»

Model |Model Items | User Groups | double-click the selected user group or click Edit.
or
In Model Explorer | User Groups folder | double-click the selected user group or
right-click | Edit.

Toad Data Modeler User Guide

203

Projects and Models

Option

Description

Object
Navigator
Box

All user groups of your model are listed here. The
combo-box allows you to edit them, one by one from
one place. Use Apply to confirm all the changes you
make.

General
Tab

Description

Caption

Logical user group name

Name

Physical user group name

Membership
Tab

Description

Available

Available user groups

Selected

Selected user groups

Members
Tab

Description

User
Groups
section

You can create another group in already existing group.
(This is possible for some databases.)

Users
section

Here, you can assign users to a group.

To Do
Tab

On this tab, you can write some tasks on the selected user
group.

From the list of existing groups, select a group and click
the Add arrow button.

Note: You can assign users to a user group also in the
Users dialog.

Note: To see all To Do tasks, select Model | To Do.
Tips:
1. To copy user groups, use CTRL + Drag&Drop techniques.
2. To move user groups, use Drag&Drop techniques.
You can copy and move your user groups within a model and between models of the
same and different databases:
l

In User Groups dialog (Model menu)

l

In Model Explorer | User Groups folder

Toad Data Modeler User Guide

204

Projects and Models

l

Between Model Explorer and User Groups dialog

3. To delete user groups, select:
l

Model |Model Items | User Groups  | Select a user group and click Delete.

l

Model Explorer | User Groups folder | Right-click and select Delete Item.

Related Topics
Method A - via the Users dialog (page 200)
PermissionsIn Toad Data Modeler, you can assign permissions to the following objects: Entity,
Attribute, User Data Type, View, Procedure, Schema, Users and User Groups.A list of permitted
objects varies according to a database type. E.g. in some databases, it's not possible to assign a
permission for Users.For every object, different permissions can be set (SELECT, INSERT,
UPDATE etc.), depending on selected database.Options for permissions are described in the
following example of permissions for entity. Permissions for attribute, user data type etc. are set
in the Properties dialog of particular object | Permissions tab. Add PermissionsTo be able to add
a Permission, it's necessary to define a User or User Group. If you forget to define them first,
never mind. Toad Data Modeler allows you to define them directly on tab Permissions of the
appropriate object - click Users or User Groups. To add a permission for entityIn the Entity
Properties form, select the Permissions tab and click Add. Tip: You can also add a permission in
the Model Explorer | Entities folder | Unfold the selected entity. | Right-click the Permissions
item. | Add PermissionUser or User Group must exist to be able to add a permission.Example:
Created permission in the Entity Properties form:After you add a new permission and confirm
Apply, a new item (user or user group) will display (e.g. Dave).If you want to add the created
permission to another user or user group, press F2 and select appropriate user or user group from
the User (User Group) box.Define items in other columns in the same way (F2 or via inplace
editor) - Grantor, SELECT etc.Permissions TabDescriptionUser (User Group)Name of user (group)
that the permission has been assigned to.GrantorName of user (group) that has assigned a user
(group) the permission.Permissions: SELECT, INSERT, UPDATE, DELETE, RULE,
REFERENCES, TRIGGERTo edit a permissionIn the Entity Properties form | Permissions  tab,
double-click the selected permission or press Edit .Tip: You can also edit/rename/delete
permissions in Model Explorer | EntityName folder | Permissions | Right-click the selected
permission.General TabDescriptionPermissionsList of all available permissions to particular
object.StatusShows if the particular permission has been assigned or not.Unchanged - No change
has been made.Grant - Permission has been granted.Deny - Permission has been denied. (E.g. in
MS SQL 2005 models.)with Grant OptionYes/No - Says if the permission can be assigned also to
another user (group). Tip: To delete a permission, in the Entity Properties form | Permissions tab,
select the permission and click Delete. Related TopicsUsersUser GroupsPER - PER Conversion
Information (page 1)
PER - PER Conversion Information (page 425)

Toad Data Modeler User Guide

205

Projects and Models

Basic Database Design
Select Target Database
Toad Data Modeler supports several database systems and also specifics of the particular
database system. Therefore, when you want to create a new ERD from scratch, you have to select
a target database first.

Scenario
Create Oracle 10g physical model Videorental.
1. Click

on the toolbar (also CTRL+N).

2. Click the Physical Data Model tab and select a target database - Oracle 10g.
3. To the Model Name box, write the model name Videorental.
4. Confirm OK.

Result:
l

The model will be listed in the Application View.

l

In the Application Window, designer for the Workspace All Items will open
automatically.

l

The status bar in the Application Window displays the database name. (DB: Oracle 10g
in our example.)

l

Main menu and the Designer toolbar for physical data model will activate.

Notes:
l

Database Name - A database for which the model is created (e.g. Oracle 10g). The
database name information can be found at the bottom of the Application Window, or is
displayed in the pop-up hint when you point your mouse cursor at the Model Name in
the Application View.

l

Model Name - A model can be saved to more files. In Toad Data Modeler, Model Name
should be understood as a title of a document that can be saved to several files of a
different name.

l

File Name - A name of file where the model is saved. File Name is defined after you
select Save Model or Save Model as.

l

See "Rename" (page 515) for more information.

Related Topics
Create Entities (page 206)

Toad Data Modeler User Guide

206

Projects and Models

Create Entities
In Toad Data Modeler, there are several ways how to create entities - on the Workspace, via
Model Explorer and in the Entities dialog (Model | Entities). All the options are described in
the Help file. Here, you will create entities directly on the Workspace.

Scenario
Create entity Customer on the Workspace in your Videorental model.
1. Click

on the toolbar (also CTRL+E) and then click anywhere on the work area.

2. Double-click the entity to edit it.
3. Define the entity caption and name

Caption

Logical entity name - Customer.

Name

Physical entity name - T_CUSTOMER.

Toad Data Modeler User Guide

207

Projects and Models

Tip: See About Naming Conventions for more information.
Note: Appropriate entity name will be displayed on the
Workspace according to the view you select (View menu |
Display Mode).
4. Define other properties on tab General and other tabs (e.g. Notes, Comments etc.). To
save the changes simultaneously and leave the form open, click Apply.
Note: It is possible to define default values for objects of your model. Please see the Help file,
"Default Values" topic for more details.

Related Topics
Create Attributes (page 207)
Create Attributes

Scenario
Create attribute Customer ID in the Customer entity.
1. In the Entity Properties form of the Customer entity, click the Attributes tab.
2. Click Add to create Attribute1.
Tip: You can also use the quick Add button. - Write the attribute name and click
the small Add button then.
3. Confirm Apply to be able to edit the attribute.
4. Click Edit (or double-click the attribute) to specify its properties.

Toad Data Modeler User Guide
Projects and Models

5. Define properties of the attribute on tab General.

Caption

Logical entity name - Customer ID

Name

Physical entity name -customer_id
Tip: See About Naming Conventions for more
information.

Primary
Key
Not
Null
Unique

Select Primary Key to add the column to
primary key.
Select Not Null checkbox to define the attribute
as not null (must have a value).
Notes:

208

Toad Data Modeler User Guide

209

Projects and Models

Data
Type

l

Toad Data Modelerallows you to
select/clear the NotNull property for PK
and AK attributes. You have this
possibility only if the Allow Null
Attributes in Keys checkbox is selected
in Settings | Options | Physical Model. If
this checkbox is not selected, Toad Data
Modeler doesn’t allow you to clear the
NotNull checkbox in key attributes. The
availability of this option differs by
database. For more details, please see the
Help file, "Create Keys" topic, "NotNull
Property for PK and AK Attributes"
section.

l

You can select the Unique box to define
the attribute as a unique item. If you
create a unique attribute, an alternate key
for this attribute will be created
automatically on the Keys tab of the
Entity Properties form.

Select Data Type from the drop-down menu Integer.
Note: If you selected e.g. Char(x) data type, you
could define Length and Column Length in
values.
Tip: Before you create new attributes, you can
set up a default data type, including parameters,
for particular database. See the Settings menu |
Options | Physical Model | particular database
version | Default Data Type combo-box. (The
selected data type will be applied also for
Dictionary Types and Domains.)

6. Feel free to define other database dependent options on tab General and also on other
tabs of the Attribute Properties dialog.
7. Confirm OK.

Related Topics
Create Primary Key
Select Colors for Attributes and Keys (page 350)

Toad Data Modeler User Guide

210

Projects and Models

Create Primary Key
»

In the Entity Properties form | Keys tab | click Add.

l

l

Primary keys are graphically marked by red key.

Keys do NOT migrate in Logical models, but only in Physical models. In Logical model,
only logical information is available. The relationships have only a logical meaning
(therefore keys do not migrate). However, in Physical model the information on foreign keys
is necessary. Therefore when you convert the Logical model to Physical model, FKs will be
displayed properly in the physical model. It is done automatically and there is not any way
to avoid doing this automatically.

Related Topics
PER - LER Conversion Information (page 428)
Migration of Keys

Toad Data Modeler User Guide

211

Projects and Models

Create Relationships
1. Select a relationship type - click the appropriate relationship icon on the toolbar:
Identifying relationship (also CTRL+R)
Non-identifying relationship
M:N relationship
2. Move your mouse cursor over the work area. (The cursor changes its appearance.)
3. Click the first entity (parent) and then the target entity (child).
Tips:
l

Select a mode for creating relationships - Straight Mode or Right Angled mode.See
"Straight Mode" (page 171) for more information.

l

While creating a relationship, you can add handle points. Click the parent entity and then
click the work area as many times as many handle points you want to create. Finally click
the child entity.

l

Make only horizontal and vertical relationship lines:
1. Select a relationship type and click the parent entity.
2. Press SHIFT and hold the key down. - Now only vertical and horizontal lines will
be offered to you wherever you move your mouse cursor. (Click the work area to
create some handle points.)
3. Finally, click the child entity.

l

Hide relationship names:
1. Right-click the Workspace and select Workspace Format.
2. In the Workspace Format dialog | General tab, clear the Display Line Names
checkbox.

To create self-relationship for non-identifying relationship
1. Click the Non-identifying relationship icon on the toolbar

.

2. Move your mouse cursor over the work area.
3. Double-click the selected entity on the Workspace.
Tip: Before you create a self-relationship, select Settings | Options | Physical Model | Self
Relation Attribute Name/Caption and define a name for propagated attributes there (e.g. via
prefix, suffix, application variable.)

Toad Data Modeler User Guide

212

Projects and Models

To add multiple relationships

1. Press SHIFT and click the Relationship icon. See the blue frame in the icon now.
2. Create as many relationships in you model as you need.
3. Right-click the work area (or click the Relationship icon again) to turn this function off.
Note: This function can be applied for any object on the toolbar.

Related Topics
Buttons: (page 168)
Linking Method (page 121)
Synchronization of NotNull and Mandatory Parent (page 127)
Automatic FK Mapping (page 130)
Features (page 374)
Default Values (page 470)
PER - LER Conversion Information (page 428)
Define Cardinality

Scenario
You need to set up cardinality 1:5 for the relationship Makes.
1. Double-click the Makes relationship on the Workspace.
2. Click the General tab | Cardinality area.
3. Type 5 to the Cardinality box.

Toad Data Modeler User Guide

213

Projects and Models

4. To display the cardinality in your ER diagram, select Notation | IDEF1X.

Synchronization of NotNull and Mandatory Parent.
Select Settings | Options | Physical Model | General tab | Synchronize Not Null with
Mandatory Parent.
By default, this checkbox is selected. You can change the setting during your modeling, the new
setting will be used for new items you will create in your model straight away.

Toad Data Modeler User Guide

214

Projects and Models

Synchronization enabled: If cardinality is set Mandatory Parent, the FK attribute will be
automatically Not Null. If you clear the Not Null checkbox of the FK attribute, Mandatory
Parent changes to optional.
Synchronization disabled: If you clear the Not Null checkbox of the FK attribute, the cardinality
of Mandatory Parent will remain unchanged.

Related Topics
Display Partiality (page 214)
Display Partiality
To define partiality for Parent and Child tables
1. Edit the selected relationship on the Workspace.
2. Click the General tab in the Relationship Properties dialog and select or clear the
Mandatory Parent and Mandatory Child checkboxes.
See how the relationship will look like for different partiality (to display cardinality in your ER
diagram, select Notation | IDEF1X):
Parent: Mandatory
Child: Mandatory
A teacher MUST have a lecture (the record related to lecture is mandatory), a lecture MUST be
attached to a teacher (the record related to teacher is also mandatory. Teacher is Mandatory.)

Parent: Mandatory
Child: Optional
A teacher MAY have a lecture (the record related to lecture is Optional), a lecture MUST be
attached to a teacher (Teacher is Mandatory.)

Parent: Optional

Toad Data Modeler User Guide

215

Projects and Models

Child: Mandatory
A teacher MUST have a lecture (lecture is Mandatory), a lecture MAY be attached to a teacher
(teacher is Optional).

Parent: Optional
Child: Optional
A teacher MAY have a lecture (lecture is Optional), a lecture MAY be attached to a teacher
(teacher is Optional).

The information can be found on Relationship Properties form, see graphical representation at
bottom of the form.

Toad Data Modeler User Guide
Projects and Models

Related Topics
Set up Referential Integrity Rules (page 216)
Set up Referential Integrity Rules
To set up referential integrity rules for Parent entities
»

Open the Relationship Properties form and see the Referential Integrity group box.

Here, you can change the None rule to:
l

Restrict

l

Cascade

216

Toad Data Modeler User Guide

217

Projects and Models

l

Set Null

l

Set Default

The default rule can be re-configured.

Note: Some databases do not support Referential Integrity (RI) rules.
Tip: See the Help file, "Default Values" topic to see how to set up default referential integrity.

Related Topics
Connect Parent and Child Entities (page 218)

Toad Data Modeler User Guide
Projects and Models

Connect Parent and Child Entities
Toad Data Modeler allows you to connect Parent and Child entities through the following
unique values:
l

Key (Primary or Alternate Key) of parent entity

l

Unique Index of parent entity

To change the linking method
1. Open the Relationship Properties form and see the Relationship Type group box.
2. From the Parent Key box, select the method. If neither Unique item, nor
Alternate Key exists, only the Primary key is available.

Note: Some databases do not support Alternate Keys.
Example of generated SQL (Oracle 10g):

218

Toad Data Modeler User Guide

219

Projects and Models

Understanding of Foreign Keys
There are two types of foreign keys in Toad Data Modeler:
l

Primary Foreign keys (PFK, graphically marked by blue key).

l

Foreign keys (FK, graphically marked by green key).

PFK
As soon as you create an identifying relationship, Toad Data Modeler automatically adds a copy
of the primary key of the Parent table to the Child table - Primary Foreign Key (PFK). (The
foreign key in Child table is a part of the primary key.)

FK
As soon as you create a non-identifying relationship, Toad Data Modeler automatically adds a
copy of the primary key of the Parent table to the Child table - Foreign key (FK). (This foreign
key in Child table is not a part of the primary key.)
In other words, foreign keys (PFKs and FKs) are imported from parent entities to child entities
automatically when you create relationship. Foreign keys cannot exist without relationships.
Therefore, you are not allowed to delete FK or PFK from Child tables either. To delete them, you
have to delete appropriate relationship.
In Toad Data Modeler, information on foreign keys can be found in:
l

The Attribute Properties dialog | Foreign Keys tab where you can see details on
particular FK.

Toad Data Modeler User Guide

220

Projects and Models

l

The Relationship Properties dialog where you set up linking method between parent and
child entities.

Foreign Keys Mapping
In Toad Data Modeler, you can control your foreign keys. Foreign keys mapping feature allows
you to create Compound Keys, use existing keys etc.
Example:
You have reverse engineered a model without relationships. In Toad Data Modeler, a new model
has been created. However, information about foreign keys has been lost as in Toad Data
Modeler stands that foreign keys cannot exist without relationships. Now you need to create
relationships in Toad Data Modeler.
As soon as you create a new relationship, a new foreign key is added to the child entity
automatically or existing attribute is mapped to primary key automatically.
In case you need to choose different column for the relationship, edit the relationship and choose
the new column on tab General.

Automatic FK Mapping
You can also set Automatic FK Mapping in Settings | Options | Model | Physical Model.

Toad Data Modeler User Guide

221

Projects and Models

l

Disable—FK mapping is OFF

l

Enable—Toad Data Modeler searches for matching attributes. If a single option is found,
it gets mapped. If multiple options are found, a dialog appears.

l

Always Show Dialog—The dialog opens even if only a single option is found.

Toad Data Modeler User Guide

222

Projects and Models

Link to Parent Attribute
You can see link to parent attribute on Attribute Properties form in case the attribute is part of a
foreign key.

Scenario
You have just added a self-relationship to the Film entity.
1. A copy of your identifying key attribute has been created in the entity - Film ID. Now
you have two Film ID attributes in the Film entity.

2. Edit the newly created Film ID attribute, define a new Name . The link to parent attribute
is displayed on right top corner of the form.

Toad Data Modeler User Guide
Projects and Models

3. Confirm OK and see the change on the Workspace.

223

Toad Data Modeler User Guide

224

Projects and Models

Advanced Database Design
About Advanced Options
Toad Data Modeler supports several database systems. As there are differences among databases,
there are also some specific options that stand only for the particular database.
For example:
l

In MS SQL 2000 db, there are no user defined types but only Dictionary types.
Dictionary types are called user-defined data types in MS SQL 2000 database.

l

In PostgreSQL database, Users are not supported (only User Groups). To User Groups,
roles should be written.

l

and others.

Please read the Help file, "Databases" topic and select your database to see some screenshots and
options specific for your database.

Alternate Keys
As you already know, you can connect Parent and Child entities via:
l

Key (Primary or Alternate Key) of parent entity

l

Unique Index of parent entity

Alternate keys are used when you want to link two entities using two attributes. These two
attributes make one unique item.

Scenario
For entity Film, you need to create an alternate key with attributes Title
and Director.
1. Edit the Film entity.
2. In the Entity Properties form click the Keys tab. Here, primary keys and alternate keys
are stored, and you can manage them easily - using the Add, Edit and Delete buttons. So
now click Add to create a new key and confirm Apply.
3. Edit the new key.
4. Define its properties on tab General and then click the Attributes tab.

5. From the window Available, select attributes Title and Director and click the Add arrow
button to move them to window Selected.
6. Define properties on other tabs at your convenience (e.g. Notes) and confirm OK.
Scenario: Now you want to select this alternate key for the linking method.

Toad Data Modeler User Guide
Projects and Models

To select the alternate key for relationship
7. Double-click the relationship.
8. From the Parent Key box, select the alternate key title-director.

Indexes
To create an index
»

In the Entity Properties form, select the Indexes tab and click Add.
Tip: You can also create indexes in Model Explorer | Entities folder | Unfold the
selected entity | Right-click the Indexes item. | Add Index.

To edit indexes
»

In the Entity Properties dialog | Indexes tab, double-click the index or press Edit.
Tip: You can also edit/rename/delete indexes in Model Explorer | EntityName

225

Toad Data Modeler User Guide
Projects and Models

folder | Indexes | Right-click it the selected index.
Option

Description
Above the Object Navigator Box, you can see name
of entity that the index belongs to. Click the button
on top right- hand corner to display parent form
(Entity Properties form).

Object
Navigator box

All Indexes of selected entity are listed here. The
combo- box allows you to edit them quickly and
comfortably from one place. Click Apply to confirm
the changes so as the dialog remains opened for other
edit.

General Tab

Description

Caption

Logical index name

Name

Physical index name

Schema

Schema box selection

Unique

Select this option to set the index as unique. Via
unique indexes, you can link entities together. See
"Linking Method " (page 121) for more information
on available linking methods.

Bitmap Index

Database dependent item (Oracle). Select this
checkbox to define the index as bitmap index.

Generate

Select it to generate the index in final SQL (DDL)
script. (It is selected by default.)

Note: Other options on the General tab vary according to a database
type. Options specific for your database can be found in the "Databases"
chapter.
Items Tab

Description

Available

A list of all attributes of the entity.

Selected

Attribute(s) that have been assigned to the index.

Notes Tab

Tab for notes on the index.

Index

Description

226

Toad Data Modeler User Guide

227

Projects and Models

Properties
Tab
Tablespace

Select a tablespace or click the button on the right to
define a new tablespace.

Indextype

Index type definition

ODCI
Parameters

ODCI parameters definition

To display indexes on the Workspace
»

Right-click the WS, select Workspace Format | Entity tab and select the Display
Indexes checkbox.

See how indexes are displayed:

Note: No matter if indexes are displayed or not, you can see which attribute belongs to
which index (see e.g. attribute Name belonging to indexes i_name and i_name_address name (IX1,IX2).
To delete an index
»

In the Entity Properties dialog | select the Indexes tab, select the index and click Delete.

Check Constraints and Triggers
Toad Data Modeler supports check constraints and triggers.
You can create them on appropriate tabs in the Entity Properties form. From here, you can also
manage them easily (Add, Edit, Delete).
Example: Check Constraint (Oracle 10g model)

Toad Data Modeler User Guide
Projects and Models

228

Toad Data Modeler User Guide
Projects and Models

Example: Trigger (Oracle 10g model)

229

Toad Data Modeler User Guide
Projects and Models

230

Toad Data Modeler User Guide
Projects and Models

Views
Toad Data Modeler allows you to display and model views in your ER diagrams visually.

231

Toad Data Modeler User Guide

232

Projects and Models

You can manage Views via:
l

Model menu | Model Items |Views

l

Model Explorer | Views folder

View properties and options are database dependent.
To create a new View
1. Click

on the toolbar and then click the work area.

2. Click
on the toolbar and draw view relationships between some existing table or
view and your newly created view.
3. Double click the view relationship line to edit it. In Alias field you can specify a new
alias name for the linked table.

Toad Data Modeler User Guide

233

Projects and Models

4. Double-click the view to edit it.
5. Define properties on General tab and other tabs.
6. On tab Attributes you can select columns from the linked tables. Relationship aliases and
entities' names are displayed.

Toad Data Modeler User Guide

234

Projects and Models

7. You can use a template on SQL tab of the view.
Note: As well as for entities and relationships, you can create shortcuts of views on the
Workspaces of your model. List of view shortcuts can be found in Model Explorer | in
particular Workspace folder and in the Views folder | Shortcuts.
Related Topics
Copy Objects (page 68)
Move Objects (page 69)
Delete ObjectsIn Toad Data Modeler, there are two deletion options (see the Objects menu):
Remove from Workspace (Delete) - Removes an object shortcut from a Workspace. Delete Object

Toad Data Modeler User Guide

235

Projects and Models

- Deletes an object with all its shortcuts from model.Example:Your model has two Workspaces WS1 and WS2. You add a new entity to your model. -> The entity (its shortcuts) is contained on
both Workspaces (- Auto Complete option is enabled). However, you need to have the new
entity on WS1 only.Solution: You select the entity on the WS2 and simply press Delete. Result:
The entity shortcut in WS2 will be removed. Shortcut in WS1 will remain. The entity still exists
in your model. If you wanted to delete the entity from your model completely (including all its
shortcuts from all Workspaces), you would select the Delete Object option (or press
SHIFT+Delete). For the deletion, you could select any entity shortcut on any WS - either WS1 or
WS2. The entity would be deleted from your model. To remove shortcut of object from
WorkspaceSelect an object (shortcut of object) on the WS and press Delete.Tip: You can delete
shortcuts in Model Explorer too - select particular shortcut of an object in the Shortcuts folder |
right-click | Delete Item.To delete objects from model (including all its shortcuts)Select the
shortcut of object on Workspace and press SHIFT+Delete.Tip: You can also delete the objects:In
Model Explorer - select an object | right-click | Delete Item.In the Object dialog (Model menu |
Model Items | Entities, Relationships etc.) - select the object and click Delete.When you press
Delete or SHIFT+Delete in your ER diagram, the following message will display:Select the
action you want to perform.Note: Key shortcuts: ALT+O for OK and ALT+C for Cancel. To set
the default Delete options in Toad Data Modeler:Select Settings | Options | Dialog Boxes | Other
tab.OptionDescriptionDisplay DialogWhenever you press Delete or SHIFT+Delete in your ER
diagram, the Delete Confirmation Dialog will pop up and you will be able to select what action
you want to perform in particular case.Remove Graphical Representative of ObjectIf this option
is selected, the Delete will always remove selected shortcut(s) of object from particular
Workspace. SHIFT+Delete will have to be used to completely delete an object from your model.
Delete ObjectIf this option is selected, the Delete will completely delete selected object(s) from
your model, including all the object shortcuts. There is no option to only remove selected
shortcut(s) of object. (The Delete will replace SHIFT+Delete.) Related TopicsShortcuts of
Objects (page 1)Select Objects Physical Model Pointer and Objects Selection tool
optionsLogical Model Pointer and Objects Selection tool optionsMetamodel Pointer and Objects
Selection tool optionsSelect Links Automatically—also available from Objects menu. By default
enabled. When enabled, lines/relationships between selected objects are selected automatically.
During one selecting process you can enable and disable this option several times to select only
certain lines/relationships. To select multiple objects on Workspace, you have the following
options:Press SHIFT and click the particular objects on WS. This option works regardless
settings in Pointer and Objects Selection tool on the toolbar.Drag your mouse over the objects
on WS. (Works only for adjoining objects.)Note: If you drag your mouse from the left side, only
the objects that are entire in the frame will be selected. If you drag your mouse from the right
side, even objects that are partly in the frame will be selected. - See the following
example.Example:You want to select the Customer and Order Record entities. In Pointer and
Objects Selection tool, you must set either Select All (relationships will be also selected), Select
Entities or Select All Shapes. Drag your mouse from the left side as long as both entities are
completely in the frame (see the following image).Release your mouse button. Objects have been
selected.The result would be the same if you dragged your mouse from the right side and
included even a small part of the two entities in the frame. Tip: To select all objects on WS,
select Edit | Select All. To select more objects on WS by category or schema/ownerRight-click
the Workspace | Select Objects.Define a category or owner, or category and owner and click
Select. To select child and parent objects of the selected entity on the WorkspaceRight-click
the selected entity and select Select Parent Objects or Select Child Objects or Select Parent and

Toad Data Modeler User Guide

236

Projects and Models

Child Objects.To select multiple objects in Model Explorer and grids (e.g. Entity Properties form)
Use SHIFT or CTRL keys. Related TopicsObject ViewerSearch Objects (page 1) (page 1)

Materialized Views
Materialized Views are supported in the following databases: Oracle 11g, Oracle 10g and 9i, DB
2 v. 9.5 (LUW), DB 2 v. 9 (LUW), DB2 UDB v. 8 (LUW), Sybase SQL Anywhere 11.
Toad Data Modeler 3.x allows you to display materialized views graphically in your
ER diagram.
To add a materialized view
»

Click

on the toolbar and then click anywhere on the work area.

or
Model Explorer | Right-click the Materialized Views folder | Add
Materialized View.
Tip: Select Model | Model Items |Materialized Views and click Add in the Materialized
Views dialog. Here, you can also view all materialized views of your model.
To edit a materialized view
»

Double-click the materialized view on the Workspace.
or
Edit the materialized view in Model Explorer | Materialized Views folder |
double-click the selected materialized view (or right-click | Edit).

Option

Description

Object
Navigator Box

All materialized views of your model are listed here.
The combo-box allows you to edit them, one by one
from one place. Use Apply to confirm all the changes
you make.

General Tab

Description

Caption

Logical materialized view name

Name

Physical materialized view name

Toad Data Modeler User Guide
Projects and Models

Option

Description

Schema

Schema selection box

Note: Other options are database dependent. See particular database
reference for more information.
Categories

Category selection box

Generate

Select it to generate the materialized view in final
SQL (DDL) script.

Generate SQL
only

Select it to generate only the SQL code written on
tab SQL. The rest of items will be ignored.

SQL Tab

Write SQL code of materialized view subquery on
this tab.
See "Templates" (page 473) for more information.

Permissions
Tab

Here you can assign Users or User Groups
permissions to the materialized view.

To Do Tab

On this tab, you can write some tasks on the selected
materialized view.
Note: To see all To Do tasks, select Model | To Do.

Before Script
Tab

Whatever you write here, it will be generated before
the materialized view definition.

After Script
Tab

Whatever you write here, it will be generated after
the materialized view definition.

Notes Tab

Tab for notes on particular materialized view. The
text written here will display in a pop up dialog
when you point your mouse cursor at the materialized
view shortcut in your ER diagram.

SQL Preview
Tab

Click
at the bottom of this tab to see the part of
SQL code for the materialized view.

Refresh Tab

Use this tab to specify the default methods, modes
and times for the database to refresh the materialized
view.

Physical
Properties
Tab

Define storage characteristics of materialized view on
this tab.

Materialized

Define other materialized view characteristics on this

237

Toad Data Modeler User Guide

238

Projects and Models

Option

Description

Views
Properties
Tab

tab.

Create Index
Tab

Create index sentences are written on this tab.

Related Topics
Copy Objects (page 68)
Move Objects (page 69)
Delete ObjectsIn Toad Data Modeler, there are two deletion options (see the Objects menu):
Remove from Workspace (Delete) - Removes an object shortcut from a Workspace. Delete Object
- Deletes an object with all its shortcuts from model.Example:Your model has two Workspaces WS1 and WS2. You add a new entity to your model. -> The entity (its shortcuts) is contained on
both Workspaces (- Auto Complete option is enabled). However, you need to have the new
entity on WS1 only.Solution: You select the entity on the WS2 and simply press Delete. Result:
The entity shortcut in WS2 will be removed. Shortcut in WS1 will remain. The entity still exists
in your model. If you wanted to delete the entity from your model completely (including all its
shortcuts from all Workspaces), you would select the Delete Object option (or press
SHIFT+Delete). For the deletion, you could select any entity shortcut on any WS - either WS1 or
WS2. The entity would be deleted from your model. To remove shortcut of object from
WorkspaceSelect an object (shortcut of object) on the WS and press Delete.Tip: You can delete
shortcuts in Model Explorer too - select particular shortcut of an object in the Shortcuts folder |
right-click | Delete Item.To delete objects from model (including all its shortcuts)Select the
shortcut of object on Workspace and press SHIFT+Delete.Tip: You can also delete the objects:In
Model Explorer - select an object | right-click | Delete Item.In the Object dialog (Model menu |
Model Items | Entities, Relationships etc.) - select the object and click Delete.When you press
Delete or SHIFT+Delete in your ER diagram, the following message will display:Select the
action you want to perform.Note: Key shortcuts: ALT+O for OK and ALT+C for Cancel. To set
the default Delete options in Toad Data Modeler:Select Settings | Options | Dialog Boxes | Other
tab.OptionDescriptionDisplay DialogWhenever you press Delete or SHIFT+Delete in your ER
diagram, the Delete Confirmation Dialog will pop up and you will be able to select what action
you want to perform in particular case.Remove Graphical Representative of ObjectIf this option
is selected, the Delete will always remove selected shortcut(s) of object from particular
Workspace. SHIFT+Delete will have to be used to completely delete an object from your model.
Delete ObjectIf this option is selected, the Delete will completely delete selected object(s) from
your model, including all the object shortcuts. There is no option to only remove selected
shortcut(s) of object. (The Delete will replace SHIFT+Delete.) Related TopicsShortcuts of
Objects (page 1)Select Objects Physical Model Pointer and Objects Selection tool
optionsLogical Model Pointer and Objects Selection tool optionsMetamodel Pointer and Objects
Selection tool optionsSelect Links Automatically—also available from Objects menu. By default

Toad Data Modeler User Guide

239

Projects and Models

enabled. When enabled, lines/relationships between selected objects are selected automatically.
During one selecting process you can enable and disable this option several times to select only
certain lines/relationships. To select multiple objects on Workspace, you have the following
options:Press SHIFT and click the particular objects on WS. This option works regardless
settings in Pointer and Objects Selection tool on the toolbar.Drag your mouse over the objects
on WS. (Works only for adjoining objects.)Note: If you drag your mouse from the left side, only
the objects that are entire in the frame will be selected. If you drag your mouse from the right
side, even objects that are partly in the frame will be selected. - See the following
example.Example:You want to select the Customer and Order Record entities. In Pointer and
Objects Selection tool, you must set either Select All (relationships will be also selected), Select
Entities or Select All Shapes. Drag your mouse from the left side as long as both entities are
completely in the frame (see the following image).Release your mouse button. Objects have been
selected.The result would be the same if you dragged your mouse from the right side and
included even a small part of the two entities in the frame. Tip: To select all objects on WS,
select Edit | Select All. To select more objects on WS by category or schema/ownerRight-click
the Workspace | Select Objects.Define a category or owner, or category and owner and click
Select. To select child and parent objects of the selected entity on the WorkspaceRight-click
the selected entity and select Select Parent Objects or Select Child Objects or Select Parent and
Child Objects.To select multiple objects in Model Explorer and grids (e.g. Entity Properties form)
Use SHIFT or CTRL keys. Related TopicsObject ViewerSearch Objects (page 1) (page 1)
Procedures, Functions, Schemas, Synonyms, Defaults...
Toad Data Modeler supports procedures, functions, schemas etc., plus other database objects that
are supported by particular database system, e.g. Assemblies in SQL Server 2005 database,
Sequences in Oracle database etc. (To see the list of these objects for particular database, please
see the Help file, "Databases", "Extra Objects" topic.)
The database objects that are supported or used in (almost) all database systems are accessible via
the Model menu and are listed also in Model Explorer. (See Model | Functions, Procedures,
Schemas...)
Database objects that are specific for particular database system are available only in Model
Explorer on appropriate folders. (See Model Explorer of SQL Server 2005 model |
Assemblies folder.)
From both places, you can add, edit and delete them. - See the appropriate buttons e.g. in the
Schemas dialog (Model | Schemas), or see the pop-up menu of the selected folder or item in
Model Explorer (right-click the Sequences folder, right-click the selected sequence).
Example: Procedure for Oracle 10g model

Toad Data Modeler User Guide
Projects and Models

240

Toad Data Modeler User Guide
Projects and Models

Related Topics
User Templates
Users and User Groups
In Toad Data Modeler, you can define users, user groups and assign permissions to them.

Scenario
Create users in your model - two administrators and a manager, and user
groups Administrators and Managers.
To create users
1. Click

on the toolbar.

2. In the Users dialog, click Add three times and confirm Apply.

241

Toad Data Modeler User Guide

242

Projects and Models

3. Select User1 and click Edit.
4. Define properties on tab General

To create user groups
1. Click

on the toolbar.

2. In the User Groups dialog, click Add twice and confirm Apply.
3. Double-click UserGroup1.
4. Define name of this group - Administrators and confirm Apply.
5. From the Object Navigator box, select the other item.
6. Write its name -Managers and confirm Apply. -> The dialog remains opened.
7. Click the Members tabs of the Managers User Group Properties dialog. Here, available
user groups and users are listed, and you can add a user group and users to the Managers
user group.
8. Switch to the Manager User Properties dialog and click the Membership tab. -> Two
available user groups are there. You can assign the Manager user to the selected group.
9. In the Manager User Properties dialog, select the Managers group and confirm
Apply. -> Managers item has moved to the window Selected. Also, see the Managers
User Group Properties dialog - user Manager has been assigned to this group
automatically too.
10. Let's see how it works in the User Groups dialog now: From the Object Navigator box,
select the Administrators user group.
11. Select the two administrator users (use SHIFT key) and click the Add arrow button.
12. Confirm Apply. (You can check out e.g. the Admin1 User Properties dialog to see the
change also there - use Object Navigator box again.)
13. Close the dialogs OK.
Note: Users and User Groups are accessible in the Model menu. You can also manage them via
Model Explorer.

Permissions
In Toad Data Modeler, you can assign permissions to the following objects: Entity, Attribute,
User Data Type, View, Procedure, Schema, Users and User Groups.
A list of permitted objects varies according to a database type. E.g. in some databases, it's not
possible to assign a permission for Users.
For every object, different permissions can be set (SELECT, INSERT, UPDATE etc.), depending
on selected database.

Toad Data Modeler User Guide

243

Projects and Models

Options for permissions are described in the following example of permissions for entity.
Permissions for attribute, user data type etc. are set in the Properties dialog of particular object |
Permissions tab.

Add Permissions
To be able to add a Permission, it's necessary to define a User or User Group. If you forget to
define them first, never mind. Toad Data Modeler allows you to define them directly on tab
Permissions of the appropriate object - click Users or User Groups.
To add a permission for entity
»

In the Entity Properties form, select the Permissions tab and click Add.
Tip: You can also add a permission in the Model Explorer | Entities folder |
Unfold the selected entity. | Right-click the Permissions item. | Add Permission

User or User Group must exist to be able to add a permission.
Example: Created permission in the Entity Properties form:

After you add a new permission and confirm Apply, a new item (user or user group) will display
(e.g. Dave).
If you want to add the created permission to another user or user group, press F2 and select
appropriate user or user group from the User (User Group) box.
Define items in other columns in the same way (F2 or via inplace editor) - Grantor,
SELECT etc.
Permissions
Tab

Description

User (User
Group)

Name of user (group) that the permission has been
assigned to.

Toad Data Modeler User Guide

244

Projects and Models

Grantor

Name of user (group) that has assigned a user (group)
the permission.

Permissions: SELECT, INSERT, UPDATE, DELETE, RULE,
REFERENCES, TRIGGER
To edit a permission
»

In the Entity Properties form | Permissions  tab, double-click the selected permission or
press Edit .

Tip: You can also edit/rename/delete permissions in Model Explorer | EntityName folder |
Permissions | Right-click the selected permission.
General
Tab

Description

Permissions

List of all available permissions to particular object.

Status

Shows if the particular permission has been assigned or
not.
Unchanged - No change has been made.
Grant - Permission has been granted.
Deny - Permission has been denied. (E.g. in MS SQL
2005 models.)

with Grant
Option

Yes/No - Says if the permission can be assigned also to
another user (group).

Tip: To delete a permission, in the Entity Properties form | Permissions tab, select the
permission and click Delete.

Related Topics
Method A - via the Users dialog (page 200)
User Groups (page 202)
PER - PER Conversion Information (page 425)
Verification
Model Verification
Toad Data Modeler allows you to verify your models. You can select what items of your model
you want to check, find out what errors and flaws your model contains etc.

Toad Data Modeler User Guide

245

Projects and Models

To verify your model
1. Select Model | Verify Model... (also CTRL+F9).
2. On tab Model Objects, select Object Types and instances of objects that you want
to verify.
3. On tab Verification Settings, select options for verification. To save the settings, click
Save & Verify.
4. To see the process of verification and final result, activate the Verification Log The log
should be activated automatically. To activate the log manually, click Tools |
Verification Log.

Model Verification Form
On tab Model Objects, you can see object types as well as instances of objects that exist
in your model.

On tab Verification Settings, you can enable or disable errors, warning and hints. Additional
information is available on right side.
Rules are database dependent, the following screenshot shows rules for Microsoft SQL
Server 2012.

Toad Data Modeler User Guide

246

Projects and Models

Verification Log & Model Explorer
Results are displayed in Verification Log at bottom.
Errors, warnings and hints are displayed in Physical Model Explorer in form of small graphics
placed to right top corner of each object icon.

Toad Data Modeler User Guide
Projects and Models

Verification Log Toolbar

Verification toolbar icons:
l

Tree or Grid layout

l

Show Errors

l

Show Warnings

l

Show Hints

l

Show Model Verification Form (Allows you to specify settings)

l

Quick Model Verification (Executes model verification)

247

Toad Data Modeler User Guide

248

Projects and Models

Quick Fixes
Toad Data Modeleroffers Quick Fixes, recommended solutions for selected problems or issues.
Quick Fixes are accessible in both Verification Log andPhysical Model Explorer.

In Verification Log you can switch between Tree and Grid layouts, using the first icon on
Verification Log toolbar.
Tree layout shows Quick Fixes as hyperlinks, Grid layout allows you to apply Quick Fixes via
popup menu.

Right click an item in Grid layout to see available Quick Fixes.

Toad Data Modeler User Guide

249

Projects and Models

On Form Verification
Errors, warning and hints can be displayed directly on object form, at bottom. Quick Fixes are
not available in this mode.

Settings
Verification rules can be specified as Errors, Warnings and Hints and you can modify the
categorization in Settings.
Navigate to selected target database and define settings for Model Verification.

Toad Data Modeler User Guide
Projects and Models

Connections and Reverse Engineering
Connections
To manage database connections
Click File | Reverse Engineering | Connections...

250

Toad Data Modeler User Guide

251

Projects and Models

To create new database connection
Click the New Connection icon on toolbar (first icon on the Connections form toolbar). Define
new Connection Name.

Select target database platform.

Toad Data Modeler User Guide
Projects and Models

Choose connection method and specify details.

Select object types you wish to work with.

252

Toad Data Modeler User Guide
Projects and Models

In section Options specify detailed settings for reverse engineering tasks.

253

Toad Data Modeler User Guide
Projects and Models

Click Finish to confirm new database connection settings.
To test database connection
Click the Test Connection icon on toolbar.

254

Toad Data Modeler User Guide

255

Projects and Models

Create New Model from Database - Reverse Engineering
To create a new model
Select existing connection and click Create New Model from Database

Choose User/Schema and select items you wish to reverse engineer. Make sure you select Tables,
Views, Procedures and Functions (Types of objects can be defined during Connection creation).

Toad Data Modeler User Guide
Projects and Models

Click Execute to create new model.
Result:

256

Toad Data Modeler User Guide

257

Projects and Models

Open Object Explorer - Live Reverse Engineering
Live Reverse Engineering is a method that takes advantage of Drag and Drop technique.
1. Select connection to database and click Open Object Explorer.

2. Select what entities, views and synonyms you want to add to your model. Use SHIFT for
multiple selection.

Toad Data Modeler User Guide
Projects and Models

3. Drag and drop the selected items from the Object Palette to particular Workspace or
Model Explorer.

4. Close the Object Palette dialog.

258

Toad Data Modeler User Guide

259

Projects and Models

Import Toad for Oracle ER Diagrams
1. Select File | Import |Toad for Oracle ERD or open the Connections form and
click Import Toad ERD...

2. From the Open dialog, select particular *.erd or *.erx file and click Open.

3. If you wish to use connection string stored in ERD file, click Yes on the
following dialog window:

Toad Data Modeler User Guide
Projects and Models

4. The import starts.

5. Result:

In the .erd file, there is only information on tables. Now it is necessary to connect
to database to load information on attributes and other items of the ER diagram. In
other words, reverse engineering has to be done to create a new model in Toad
Data Modeler. The reverse engineering should be completed automatically and the
only information you might need is password to your database connection.

Related Topics:
Command Line Parameters (page 379)

260

Toad Data Modeler User Guide

261

Projects and Models

Load Models from DDL/SQL Script
Toad Data Modeler enables you to load models from SQL script. This feature is not available for
all supported database platforms.
Loading from SQL Scripts is very similar to loading of database structures from physically
existing databases. You need to define "connection" to your SQL file and then you can either
reverse engineer the database structure or open Object Explorer and add objects to existing
model using Drag and Drop technique.
To manage database connections
Click File | Reverse Engineering | Connections...

To create new SQL file connection
Follow instructions described in topic Connections.
Click the New Connection icon on toolbar (first icon on the Connections form toolbar) and
follow instructions. In second step, select item from DDL Script RE section.

Toad Data Modeler User Guide

262

Projects and Models

Universal DB/ANSI Model
Toad Data Modeler allows you to reverse engineer a database structure of unsupported database
platform. Tables, columns, primary keys, indexes, relationships, procedures and views are loaded
(depends on database). Then it is necessary to convert the reversed model to a model of any
supported databases. See "Convert Physical Models (PER)Toad Data Modeler allows you to
convert:PER model into a model of another database systemPER model to LER model and vice
versaClick Model | Conversion...to open Sync & Convert Wizard.See Sync & Convert Wizard for
more information.See Simple Model Conversion for more information. ScenarioConvert your
Oracle 10g model Videorental to MS SQL 2008. Use the Sync & Convert Wizard. Click on the
toolbar to open the Sync & Convert Wizard.On the Action page, select Convert Model to
Another Target Database System.On the Select Left Side page, select File (*.txp, *.txl). Click the
button on the right to find model Videorental in the Open dialog.On the Select Right Side page,
select a target database system MS SQL 2008.On the Settings page, select Comment Out
Database Specific Items.Tip: You can select whether you want to comment the database specific
items or not. If you converted your Oracle 10g model to Oracle 11g, you would clear this
checkbox not to comment them.On the Select Object Types page, select Convert All.On the
Select Items page, you can select/deselect particular items of your model that you want or do not
want to convert. Leave the default selection to convert all items of model Videorental.On the
Review page, see the statistic information and define a model name for the converted model in
the New Model Name box - Videorental_Converted.Click Finish.The Sync & Convert Wizard
closes and the new model Videorental_Converted of MS SQL 2008 database opens in the
Application Window automatically. Note: Please read the User Guide for more examples on
model conversion. Related TopicsPER - PER Conversion InformationPER - LER Conversion

Toad Data Modeler User Guide

263

Projects and Models

InformationSync & Convert WizardSimple Model ConversionConvert Logical Model to Physical
Model" (page 1) for more information.
To reverse an ANSI model
Follow steps defined in topic Connections and in step Select Data Source, choose item
Universal DB.

Script Generation
Order of Generated Objects
Toad Data Modeler allows you to set order of objects before SQL/DDL script generation.
Example: You want to generate Users before User Permissions to a table.
You can change order of the following objects:
l

Domains

l

Entities

l

Views

l

Dictionary types

l

Sequences

l

Stored procedures

l

Functions

Toad Data Modeler User Guide

264

Projects and Models

l

Users

l

User data types

To set an order of objects for SQL/DDL script generation
1. Select Model | Order of Generated Objects.
2. Select objects. You can change order of a single object, selection of objects (use SHIFT or
CTRL) or a group of objects (click the name of the group, e.g. Views.)
Tip: To display full names of objects, click
3. Use
more steps.

.

to move by a single step or use drag&drop techniques to move by

Note: You can also use the pop-up menu: Top (CTRL+Up), Bottom (CTRL+Down).

The same form can be open from DDL Script Generation window. On tab Detail
Settings click Edit.

Result: Objects placed above the selected item will be generated before the item.
(E.g.: The Genre entity will be generated before the Medium entity and the Order
Record entity after the Borrowing entity.)
4. Click the Extension tab to set up other options.

Toad Data Modeler User Guide
Projects and Models

Options for keys:
l

After each CREATE TABLE Statement

l

After CREATE TABLE Section

l

Inside CREATE TABLE Statement

Options for indexes:
l

After each CREATE TABLE Statement

l

After CREATE TABLE Section

l

Inside CREATE TABLE Statement (only indexes in MySQL)

Options for triggers (of entity and views):
l

After each CREATE TABLE Statement

l

After CREATE TABLE Section

Note: When the After CREATE TABLE Section option is selected for an object, the
object will not be displayed in SQL Preview.

265

Toad Data Modeler User Guide

266

Projects and Models

Related Topics
SQL/DDL Script Generation
Select Items
Now you are ready to start the SQL/DDL Script Generation.
Toad Data Modeler respects as many database specifics as possible and therefore you can model
almost any possible situation and generate very detailed and database specific SQL/DDL code.

Scenario
Generate DDL script for your Oracle 10g Videorental model.
Scenario: Define options on tab What to Generate.
1. Click

on the toolbar (also F9).

2. Define settings on tab What to Generate.

Toad Data Modeler User Guide

267

Projects and Models

3. In the Location of SQL File box, set up the path where the final DDL script should be
saved. By default, the path defined in the Settings menu | Options| Paths | File with
Generated Script is filled in automatically. However, you can define a different path for
each model of yours. To change the path for all your models, we recommend to change
the default path in the Settings menu | Options.
Tip: To save the changed location for particular model (and also other settings
you define in this dialog), you need to click Save Settings at the bottom of the
dialog. The new path (including other settings for script generation) will be saved
within the model. Next time you open the model, you will not have to set up the
settings again.
4. Append to File checkbox - When checked, the extra code is appended to the original file
and nothing of the original file is overwritten.
5. From the User/Schema box, select a user/schema for which you want to generate the
script. The schema selection here influences selection of entities on tab Entity List. If you
select the item --Not Specified--, SQL script for all users/schemas will be generated.
5. Make selection of Object Types and Properties for the script generation. Feel free to use
the Select All, Deselect All or Invert Selection buttons. The Auto Check button is
enabled by default, which means that all sub-items of the selected main item will be
automatically selected too. If a sub-item is selected, the main item will automatically be
selected too.
6. For bulk change of properties in column Extended Value, use the combo box next to
the buttons.
7. Click the Extended Value column at a particular item to select a command - Create,
Drop, Drop and Create, Create or Replace etc. For bulk changes in this column, use the
combo-box next to the Auto Check button.
Tips:
1. For Experts only:
a. You can change the default selected Object Types and Properties. See more details
in the Help file, "OTPs" topic.
b. You can change the default values of the Script Generation dialog. See "Set
Default Values" (page 565) for more information.
2. You can disable script generation for particular objects - see their Properties dialog and
clear the Generate checkbox (e.g. in the Entity Properties form).

Related Topics
Detailed Settings (page 267)
Detailed Settings
Scenario: On the Detail Settings tab, define other database dependent options.

Toad Data Modeler User Guide

268

Projects and Models

Checkbox Generate Permissions Only to Object Types Selected on Tab What to Generate (The
checkbox is selected by default.):
Select this checkbox to generate permissions to:
o

Objects selected on tab What to Generate

o

Objects with selected checkbox Generate

Clear this checkbox to generate permissions also to objects that are not selected on tab What to
Generate. However, in any case, the Generate checkbox must be selected for these objects.
Note: To see the details for the database you use, have a look at the Help file, "Databases"
chapter, select your database and see its "Script Generating" topic.

Related Topics
Referential Integrity (page 269)

Toad Data Modeler User Guide

269

Projects and Models

Referential Integrity
On the Referential Integrity tab, define rules for referential integrity generation.

Related Topics
Select Entities/Workspaces and Save Settings (page 269)
Select Entities/Workspaces and Save Settings
Scenario: On tab Select List, you select if you want to generate SQL/DDL script for entire
model or particular workspace and also objects that should be generated (selected entities, views,
user data types etc).
1. From the Workspace box, select Entire Model to generate DDL script for all Workspaces
of the model.
2. Clear the Generate by Property "Generate" checkbox (it's selected by default).
Note: If you leave it selected, all items where the Generate checkbox is enabled in (see
e.g. the Entity Properties form) will be selected for the script generation automatically. If
you clear it, you can make selection of individual entities, views, procedures etc. that you
want to generate, and enable the Filter.

Toad Data Modeler User Guide

270

Projects and Models

3. In the Filter box, type T_C* and click the filter icon to select all entities that fit your
criteria.
4. Save all the script generation settings you have just defined in the dialog for particular
model (selected options including the script location). - Click Save Settings.
Remember to save also your model to preserve the settings for next script
generation!
Note:You can run Verification on your selection before generating the script — click
Verify button.

Related Topics
Preview SQL Script (page 270)
Preview SQL Script
Toad Data Modeler allows you to preview the DDL script, check it out and decide whether you
want to overwrite the existing .sql file or not.
See the Show Preview checkbox on the bottom left side of the dialog. It is clear by default. See
below what happens if it is clear or selected after you press Generate.
To generate DDL/SQL script
»

Click Generate.
Tip: To see the generation process, click Show Log.

Toad Data Modeler User Guide

271

Projects and Models

A: The Show Preview Checkbox Is Clear
1. To prevent you from overwriting the existing .sql file, this confirmation message
will display:

2. Select Yes.
Note: If you selected No, the process would be interrupted and the .sql file would
not be overwritten.
Tip: Select Do not show next time if you do not want to display the dialog
next time.
3. Finally, in the log (or Message Explorer if it's opened) the following message will
display: "SQL Generation has been finished successfully."
4. Click Show Code to open the generated script in the SQL File Viewer dialog.
5. Click x to close the dialogs.
B: The Show Preview Checkbox Is Selected
1. The preview will be displayed in SQL File Viewer. Feel free to go through it. As soon as
you close the preview, the following message will display:
2. Select Yes to overwrite the existing .sql file with the SQL script shown in the preview.
Note: No interrupts the process. The following message will display in the
Message Explorer: "SQL Generation has not been finished successfully. File
cannot be saved." You can make other modifications and generate another
preview. Existing .sql file remains unchanged.
3. Click Show Code to open the generated script in the SQL File Viewer dialog.
4. Click x to close the dialogs.

Related Topics
Example of Generated Script (page 271)
Example of Generated Script
Videorental model - Oracle 10g database
Tip: Right-click the SQL File Viewer to see options Search, Find and Replace.

Toad Data Modeler User Guide
Projects and Models

/*
Created: 15.3.2007
Modified: 1.6.2011
Project: Videorental Project
Model: Videorental
Company: Quest Software, Inc.
Author: Radim Mario Tkacik
Database: Oracle 10g
*/
-- Create user data types section ------------------------------------------------CREATE TYPE SCOTT.Phone_List_Type
AS VARRAY(5) OF VARCHAR2(25)
/
CREATE TYPE SCOTT.Cust_Address_Type
AS OBJECT
( street_address VARCHAR2(40)
, postal_code VARCHAR2(10)
, city VARCHAR2(30)
, state_province VARCHAR2(10)
, country_id CHAR(2)
, phone Phone_List_Type
)
/
CREATE TYPE SCOTT.Price_Type
AS OBJECT (price NUMBER(10,2),
MEMBER FUNCTION total_price_VAT (vat number) RETURN NUMBER)
/
CREATE TYPE BODY SCOTT.Price_Type

272

Toad Data Modeler User Guide
Projects and Models

IS
MEMBER FUNCTION total_price_VAT (vat NUMBER)
RETURN NUMBER IS
BEGIN
RETURN (price*((vat+100)/100));
END;
END;
/
-- Create sequences section ------------------------------------------------CREATE SEQUENCE SCOTT.SeqExemplar
INCREMENT BY 1
START WITH 1
NOMAXVALUE
NOMINVALUE
NOCACHE
/
-- Create tables section -------------------------------------------------- Table SCOTT.T_CUSTOMER
CREATE TABLE SCOTT.T_CUSTOMER(
customer_id Integer NOT NULL,
name Varchar2(20 CHAR),
address SCOTT.Cust_Address_Type
)
/
-- Create indexes for table SCOTT.T_CUSTOMER
CREATE INDEX i_name ON SCOTT.T_CUSTOMER (name)
/
-- Add keys for table SCOTT.T_CUSTOMER

273

Toad Data Modeler User Guide

274

Projects and Models

ALTER TABLE SCOTT.T_CUSTOMER ADD CONSTRAINT pk_T_CUSTOMER PRIMARY
KEY (customer_id)
/
-- Table and Columns comments section

COMMENT ON COLUMN SCOTT.T_CUSTOMER.name IS 'Name column can contain First
and Middle name. Surname must be in different column.'
/
-- Table SCOTT.T_GENRE
CREATE TABLE SCOTT.T_GENRE(
genre_id Integer NOT NULL,
name Varchar2(20 CHAR)
)
/
-- Add keys for table SCOTT.T_GENRE
ALTER TABLE SCOTT.T_GENRE ADD CONSTRAINT pk_T_GENRE PRIMARY KEY
(genre_id)
/
-- Table SCOTT.T_MEDIUM
CREATE TABLE SCOTT.T_MEDIUM(
medium_id Integer NOT NULL,
medium_type Varchar2(20 BYTE)
)
/
-- Add keys for table SCOTT.T_MEDIUM
ALTER TABLE SCOTT.T_MEDIUM ADD CONSTRAINT pk_T_MEDIUM PRIMARY KEY
(medium_id)
/
-- Table SCOTT.T_EXEMPLAR
CREATE TABLE SCOTT.T_EXEMPLAR(

Toad Data Modeler User Guide

275

Projects and Models

exemplar_id Integer NOT NULL,
film_id Integer NOT NULL,
medium_id Integer NOT NULL,
price_per_day Integer
)
/
-- Add keys for table SCOTT.T_EXEMPLAR
ALTER TABLE SCOTT.T_EXEMPLAR ADD CONSTRAINT pk_T_EXEMPLAR PRIMARY
KEY (exemplar_id)
/
ALTER TABLE SCOTT.T_EXEMPLAR ADD CONSTRAINT ak_exemplar_ppd UNIQUE
(exemplar_id,price_per_day)
/
-- Table SCOTT.T_FILM
CREATE TABLE SCOTT.T_FILM(
film_id Integer NOT NULL,
title Varchar2(50 CHAR) NOT NULL,
director Varchar2(30 CHAR) NOT NULL,
production_company Varchar2(50 CHAR),
genre_id Integer NOT NULL,
min_age Integer,
film_ID_episodes Integer
)
/
-- Add keys for table SCOTT.T_FILM
ALTER TABLE SCOTT.T_FILM ADD CONSTRAINT pk_T_FILM PRIMARY KEY (film_id)
/
ALTER TABLE SCOTT.T_FILM ADD CONSTRAINT ak_title_director UNIQUE (title,director)
/

Toad Data Modeler User Guide
Projects and Models

-- Table and Columns comments section

COMMENT ON COLUMN SCOTT.T_FILM.production_company IS 'Company name must
contain also information about company type - LTD, Inc. and so on.'
/
-- Table SCOTT.T_BORROWING
CREATE TABLE SCOTT.T_BORROWING(
exemplar_id Integer NOT NULL,
customer_id Integer NOT NULL,
start_date Date DEFAULT sysdate,
end_date Date,
total_price SCOTT.Price_Type,
VAT Number(4,2) DEFAULT 19,
CONSTRAINT check_end_after_start CHECK ((end_date>start_date) or (end_date is null))
)
/
-- Add keys for table SCOTT.T_BORROWING
ALTER TABLE SCOTT.T_BORROWING ADD CONSTRAINT pk_T_BORROWING
PRIMARY KEY (exemplar_id)
/
-- Create triggers for table SCOTT.T_BORROWING
CREATE TRIGGER SCOTT.tri_BORROWING
BEFORE INSERT
ON SCOTT.T_BORROWING
FOR EACH ROW
declare price number(10,2);
begin
select price_per_day
into price

276

Toad Data Modeler User Guide
Projects and Models

from T_EXEMPLAR
where T_EXEMPLAR.exemplar_id = :new.exemplar_id;
:new.total_price := Price_Type((:new.end_date-:new.start_date)*price);
end;
/
CREATE TRIGGER SCOTT.tru_BORROWING
BEFORE UPDATE
ON SCOTT.T_BORROWING
FOR EACH ROW
declare
price number(10,2);
total_price_old number(10,2);
end_d date;
start_d date;
begin
select e.price_per_day
into price
from T_EXEMPLAR e
where e.exemplar_id = :new.exemplar_id;
total_price_old := :new.total_price.price;
end_d := :new.end_date;
start_d := :new.start_date;
if (total_price_old is null) then
total_price_old := 0;
end if;
if ((end_d-start_d)*price != total_price_old) then
:new.total_price := Price_Type((end_d-start_d)*price);
end if;

277

Toad Data Modeler User Guide

278

Projects and Models

end;
/
-- Table and Columns comments section

COMMENT ON TABLE SCOTT.T_BORROWING IS 'Borrowed items'
/
-- Table SCOTT.T_ORDER_RECORD
CREATE TABLE SCOTT.T_ORDER_RECORD(
customer_id Integer NOT NULL,
film_id Integer NOT NULL,
order_date Date
)
/
-- Add keys for table SCOTT.T_ORDER_RECORD
ALTER TABLE SCOTT.T_ORDER_RECORD ADD CONSTRAINT pk_T_ORDER_RECORD
PRIMARY KEY (customer_id,film_id)
/
-- Table and Columns comments section

COMMENT ON TABLE SCOTT.T_ORDER_RECORD IS 'All records are stored in list of
records. It will be possible to book a movie.'
/
-- Table SCOTT.T_CUSTOMER_RATING
CREATE TABLE SCOTT.T_CUSTOMER_RATING(
title Varchar2(50 CHAR) NOT NULL,
director Varchar2(30 CHAR) NOT NULL,
rating Integer DEFAULT 3
CONSTRAINT check_rating CHECK (rating > 0)
)

Toad Data Modeler User Guide

279

Projects and Models

/
-- Add keys for table SCOTT.T_CUSTOMER_RATING
ALTER TABLE SCOTT.T_CUSTOMER_RATING ADD CONSTRAINT pk_T_CUSTOMER_
RATING PRIMARY KEY (title,director)
/
-- Table and Columns comments section

COMMENT ON TABLE SCOTT.T_CUSTOMER_RATING IS 'Movie ratings (by customers)'
/
-- Create procedures section ------------------------------------------------CREATE PROCEDURE SCOTT.p_Customer_Has_Num_Film(cid IN integer, num OUT integer)
AS
BEGIN
SELECT count(*)
INTO num
FROM T_CUSTOMER c, T_BORROWING b, T_EXEMPLAR e, T_FILM f
WHERE c.customer_id=cid
and c.customer_id=b.customer_id
and b.exemplar_id=e.exemplar_id
and e.film_id=f.film_id;
END;
/
-- Create views section ------------------------------------------------CREATE VIEW SCOTT.v_Customer_Has_Film AS
SELECT DISTINCT c.name, c.address.city AS city, f.title, f.director
FROM SCOTT.T_CUSTOMER c, SCOTT.T_BORROWING b, SCOTT.T_EXEMPLAR e,
SCOTT.T_FILM f
WHERE c.customer_id=b.customer_id
and b.exemplar_id=e.exemplar_id

Toad Data Modeler User Guide

280

Projects and Models

and e.film_id=f.film_id
/
-- Create functions section ------------------------------------------------CREATE FUNCTION SCOTT.f_Customer_Has_Num_Film(cid IN integer)
RETURN integer
IS
sol integer;
BEGIN
p_Customer_Has_Num_Film(cid,sol);
RETURN (sol);
END;
/
-- Trigger for sequence SCOTT.SeqExemplar for column exemplar_id in table SCOTT.T_
EXEMPLAR --------CREATE OR REPLACE TRIGGER SCOTT.ts_T_EXEMPLAR_SeqExemplar BEFORE INSERT
ON SCOTT.T_EXEMPLAR FOR EACH ROW
BEGIN
SELECT SCOTT.SeqExemplar.nextval INTO :new.exemplar_id FROM DUAL;
END;
/
CREATE OR REPLACE TRIGGER SCOTT.tsu_T_EXEMPLAR_SeqExemplar AFTER
UPDATE OF exemplar_id
ON SCOTT.T_EXEMPLAR FOR EACH ROW
BEGIN
RAISE_APPLICATION_ERROR(-20010,'Cannot update column exemplar_id in table SCOTT.T_
EXEMPLAR as it uses sequence.');
END;
/
-- Create relationships section -------------------------------------------------

Toad Data Modeler User Guide

281

Projects and Models

ALTER TABLE SCOTT.T_BORROWING ADD CONSTRAINT makes FOREIGN KEY
(customer_id) REFERENCES SCOTT.T_CUSTOMER (customer_id)
/
ALTER TABLE SCOTT.T_BORROWING ADD CONSTRAINT is_related_to FOREIGN KEY
(exemplar_id) REFERENCES SCOTT.T_EXEMPLAR (exemplar_id)
/
ALTER TABLE SCOTT.T_ORDER_RECORD ADD CONSTRAINT places FOREIGN KEY
(customer_id) REFERENCES SCOTT.T_CUSTOMER (customer_id)
/
ALTER TABLE SCOTT.T_EXEMPLAR ADD CONSTRAINT is_available_on FOREIGN KEY
(medium_id) REFERENCES SCOTT.T_MEDIUM (medium_id)
/
ALTER TABLE SCOTT.T_ORDER_RECORD ADD CONSTRAINT is_required_by FOREIGN
KEY (film_id) REFERENCES SCOTT.T_FILM (film_id)
/
ALTER TABLE SCOTT.T_FILM ADD CONSTRAINT is_of FOREIGN KEY (genre_id)
REFERENCES SCOTT.T_GENRE (genre_id)
/
ALTER TABLE SCOTT.T_EXEMPLAR ADD CONSTRAINT has FOREIGN KEY (film_id)
REFERENCES SCOTT.T_FILM (film_id)
/
ALTER TABLE SCOTT.T_CUSTOMER_RATING ADD CONSTRAINT is_rated FOREIGN
KEY (title, director) REFERENCES SCOTT.T_FILM (title, director)
/
ALTER TABLE SCOTT.T_FILM ADD CONSTRAINT has_more_episodes FOREIGN KEY
(film_ID_episodes) REFERENCES SCOTT.T_FILM (film_id)
/
-- Grant permissions section ------------------------------------------------insert into T_GENRE values (1,'crime')
/
insert into T_GENRE values (2,'western')
/

Toad Data Modeler User Guide

282

Projects and Models

insert into T_GENRE values (3,'drama')
/
insert into T_GENRE values (4,'biography')
/
insert into T_GENRE values (5,'comedy')
/
insert into T_MEDIUM values (1,'CD - DivX')
/
insert into T_MEDIUM values (2,'CD - VideoCD')
/
insert into T_MEDIUM values (3,'DVD')
/
insert into T_MEDIUM values (4,'Videotape')
/
insert into T_FILM values (1,'The Shawshank Redemption','Frank Darabont','Castle Rock
Entertainment',1,15, null)
/
insert into T_FILM values (2,'The Godfather','Francis Ford Coppola','Paramount
Pictures',1,15,null)
/
insert into T_FILM values (3,'The Godfather: Part II','Francis Ford Coppola','Paramount
Pictures',1,15,2)
/
insert into T_FILM values (4,'The Good, the Bad and the Ugly','Sergio Leone','PEA',2,15,null)
/
insert into T_FILM values (5,'Pulp Fiction','Quentin Tarantino','Miramax Films',1,18,null)
/
insert into T_FILM values (6,'12 Angry Men','Sidney Lumet','Orion-Nova Productions',3,15,null)
/
insert into T_FILM values (7,'Schindler''s List','Steven Spielberg','Universal Pictures',4,15,null)

Toad Data Modeler User Guide
Projects and Models

/
insert into T_FILM values (8,'One Flew Over the Cuckoo''s Nest','Milos Forman','Fantasy
Films',3,15,null)
/
insert into T_EXEMPLAR values (1,1,3,3)
/
insert into T_EXEMPLAR values (2,1,3,3)
/
insert into T_EXEMPLAR values (3,1,3,3)
/
insert into T_EXEMPLAR values (4,1,4,2)
/
insert into T_EXEMPLAR values (5,1,4,2)
/
insert into T_EXEMPLAR values (6,2,3,3)
/
insert into T_EXEMPLAR values (7,2,4,2)
/
insert into T_EXEMPLAR values (8,3,3,3)
/
insert into T_EXEMPLAR values (9,4,4,2)
/
insert into T_EXEMPLAR values (10,5,3,3)
/
insert into T_EXEMPLAR values (11,6,4,2)
/
insert into T_EXEMPLAR values (12,6,4,2)
/
insert into T_EXEMPLAR values (13,7,4,2)

283

Toad Data Modeler User Guide

284

Projects and Models

/
insert into T_CUSTOMER values (1,'Audrey',Cust_Address_Type('92A Campton
Avenue','60021','Fox River Grove',null,'us',null))
/
insert into T_CUSTOMER values (2,'Simon',Cust_Address_Type('12 Hillpeak
Street','60006','Arlington Heights',null,'ca',null))
/
insert into T_CUSTOMER values (3,'Dave',Cust_Address_Type('31D South
Avenue','60001','Alden',null,'us',Phone_List_Type('541 123 456')))
/
insert into T_CUSTOMER values (4,'Chris',Cust_Address_Type('5 Quiet Street','60061','Vernon
Hills',null,'us',Phone_List_Type('541 123 456','596 815 641')))
/
insert into T_CUSTOMER values (5,'Elen',Cust_Address_Type('47 My Avenue','60083','Beach
Park','Illinois','us',null))
/
insert into T_BORROWING (exemplar_id,customer_id,start_date,end_date) values (11,1,to_date
('01-01-2010','DD-MM-YYYY'),to_date('03-01-2010','DD-MM-YYYY'))
/
insert into T_BORROWING (exemplar_id,customer_id,start_date,end_date) values (12,2,to_date
('02-01-2010','DD-MM-YYYY'),to_date('10-01-2010','DD-MM-YYYY'))
/
insert into T_BORROWING (exemplar_id,customer_id,start_date) values (1,2,to_date('06-012010','DD-MM-YYYY'))
/
insert into T_BORROWING (exemplar_id,customer_id,start_date) values (6,4,to_date('07-012010','DD-MM-YYYY'))
/
insert into T_BORROWING (exemplar_id,customer_id,start_date) values (7,3,to_date('07-012010','DD-MM-YYYY'))
/
insert into T_BORROWING (exemplar_id,customer_id) values (9,3)
/

Toad Data Modeler User Guide

285

Projects and Models

insert into T_ORDER_RECORD values (1,2,to_date('01-01-2010','DD-MM-YYYY'))
/
insert into T_ORDER_RECORD values (1,1,to_date('01-01-2010','DD-MM-YYYY'))
/
insert into T_ORDER_RECORD values (2,2,to_date('03-01-2010','DD-MM-YYYY'))
/
insert into T_ORDER_RECORD values (3,3,to_date('06-01-2010','DD-MM-YYYY'))
/

Select Encoding
To set up encoding for the generated script
1. Select Settings | Options | Physical Model | General tab | SQL Script area.
2. From the Encoding Used for SQL Scripts box, select the encoding you prefer,
e.g. UTF-8.

Toad Data Modeler User Guide

286

Projects and Models

Note: Here, you can also define External Editor for the generated SQL script or alter script.
External editor enables you to open the file with generated SQL, it doesn't allow you to edit all
SQL codes. Via this feature, you can view the generated SQL code in the program you prefer,
and possibly execute the script from there.
See "About Integration Options" (page 650) for more information.

Related Topics
Select Items (page 266)
Convert Physical Models (PER)
Toad Data Modeler allows you to convert:
l

PER model into a model of another database system

l

PER model to LER model and vice versa

Click Model | Conversion...to open Sync & Convert Wizard.
See "Sync & Convert Wizard" (page 438) for more information.
See "Simple Model Conversion" (page 434) for more information.

Toad Data Modeler User Guide

287

Projects and Models

Scenario
Convert your Oracle 10g model Videorental to MS SQL 2008. Use the
Sync & Convert Wizard.
1. Click

on the toolbar to open the Sync & Convert Wizard.

2. On the Action page, select Convert Model to Another Target Database System.
3. On the Select Left Side page, select File (*.txp, *.txl). Click the button on the right to
find model Videorental in the Open dialog.
4. On the Select Right Side page, select a target database system MS SQL 2008.
5. On the Settings page, select Comment Out Database Specific Items.
Tip: You can select whether you want to comment the database specific items or
not. If you converted your Oracle 10g model to Oracle 11g, you would clear this
checkbox not to comment them.
6. On the Select Object Types page, select Convert All.
7. On the Select Items page, you can select/deselect particular items of your model that you
want or do not want to convert. Leave the default selection to convert all items of model
Videorental.
8. On the Review page, see the statistic information and define a model name for the
converted model in the New Model Name box - Videorental_Converted.
9. Click Finish.
10. The Sync & Convert Wizard closes and the new model Videorental_Converted of MS
SQL 2008 database opens in the Application Window automatically.
Note: Please read the User Guide for more examples on model conversion.

Related Topics
PER - PER Conversion Information (page 425)
PER - LER Conversion Information (page 428)
Sync & Convert Wizard (page 438)
Simple Model Conversion (page 434)
Conversion to Physical Model (page 310)

Toad Data Modeler User Guide

288

Projects and Models

Universal Data Model
Benefits of Universal Data Model
Universal (Generic Relational) Data Model allows you to model entity relationship diagrams
without the necessity to select target database platform and database specific items.
Specifics of Universal (Generic Relational) Data Model
l

in Universal Data Models PK attributes migrate from parent to child entities as PFK or
FK attributes

l

it is necessary to convert model to target database platform if you decide to generate SQL
for your Universal Data Model

l

reports can be generated in various formats

l

reverse engineering via ADO/ODBC is available

Logical Data Model
About Logical Data Modeling
Toad Data Modeler allows you to design and maintain a logical model giving a complete picture
of the business area. Logical model is independent of the database platform and is much simpler
than physical model. It uses objects such as inheritance, valid values or M:N relationships. From
the Logical ER (LER) diagram, you can build a Physical ER (PER) diagram of the selected
database platform (LER to PER conversion).
Notes:
l

This chapter contains information on objects and functions that are specific for logical
modeling. General information and other features applicable in Logical model as well as
in Physical model are contained and described in other sections of this Help file. See e.g.
the "Model Objects" chapter, "Model Explorer" topic etc.

l

See the sample logical model Employee that is included in the installation package for
Toad Data Modeler. Default location is: C:\Program Files\Quest Software\Toad Data
Modeler 4.0\Samples.

To create a logical model
»

Select File | New | Model |Logical Data Model tab.

Toad Data Modeler User Guide

289

Projects and Models

Related Topics
Main Menu and Toolbars
Create Logical Model
Benefits of Logical Data Model
Logical Data Model allows you to model inheritances in entity relationship diagrams. Neither
Universal Data Model nor Physical Data Model offer this feature.
Specifics of Logical Data Model
l

there are three methods how inheritance can be converted to physical model

l

attributes don't migrate to child entities

l

it is not possible to define specific items in Logical Model, for example

Toad Data Modeler User Guide

290

Projects and Models

sequences/autoincrements etc.
l

you can define Valid Values in logical model (will be converted to physical model)

Benefits of Super and Sub Types
In Logical Model you can define database structure in various ways. See the pictures below.
Both of them show a structure modeled in Logical Model and both the models will result in the
identical output when converted to Physical Model. The difference is that Model A uses Super
and Sub Types while Model B doesn't use inheritance at all.
Model A - Utilizing Super and Sub Types

Toad Data Modeler User Guide

291

Projects and Models

Model B - Lacking Super and Sub Types

This example shows:
1. that you can create logical models in different ways and achieve the same result after
conversion to physical model
2. better productivity and the advantage of using inheritance – when you decide to change
Last name attribute to Surname, it will be necessary to change the attribute on one place
in Model A and three times in Model B.
3. how “readable” the first model is in comparison with the second
4. how important the possibility to select rules for inheritance conversion in Toad Data
Modeler is.
5. that creating logical models without inheritance has minimal benefit and if no inheritance
is used, physical model should be the right choice.

Disadvantage
The main disadvantage of logical modeling is that direct synchronization with existing
database is not possible. Look at the diagrams above again. Both of them, when converted to
physical model, result in identical output. But if we tried to reverse engineer the output back to
logical model, the software would not know rules for possible inheritance conversion.

Toad Data Modeler User Guide

292

Projects and Models

Objects in Logical Model
Objects in Logical Model
l

Entity

l

Relationship (Identifying and non-identifying)

l

Inheritance

l

Stamp

l

Category (Caption of Categories)

All these objects are available in the Objects menu or via icons in the Designer toolbar.
Tips:
1. Besides these objects you can add also other graphical shapes to your ER diagram. See
"Model Independent Graphics" (page 79) for more information.
2. See "Arrange Objects in Layers" (page 336) for more information.

Related Topics
Objects Menu (page 51)
ModelsModel ObjectsAdd ObjectsToad Data Modeler allows you to add objects from multiple
places. See the following options.To add an object on WorkspaceClick an object icon on the
toolbar, e.g. for entity.Click anywhere on the work area to add the object.Tip: Use hot keys, e.g.
CTRL+E for entity, CTRL+I for inheritance, or select the object from the Objects menu. To add
multiple objects on WorkspacePress SHIFT and click the object icon. A blue frame will appear
in the icon (for an entity e.g. ). Click the work area as many times as many objects you need to
add.Right-click the work area (or click the object icon again) to turn this function off. Tip: Use
this function to add any object on the toolbar (view, note etc.). To add objects in Model
ExplorerFind the object type name in the tree (e.g. Entities) | right-click and select Add (Add
Entity). To add objects from Model menuSelect Model | Model Items | the object type (e.g.
Entities). In the dialog (Entities), click Add. Related TopicsHot Keys (page 1)Model Explorer
(page 1) (page 1)
Format Logical Objects
1. Right-click the Workspace in your logical model and select Workspace Format.
2. Click the Entity tab.
Option

Description

Align

Aligns entity columns.

Toad Data Modeler User Guide
Projects and Models

Option

Description

Display
Data Types

Displays Data Types in entity.

Display
Keys
Graphically

Displays graphical icons of keys in entity.

Display
Level

Select items you need to display in your
logical model - Entities, Primary Identifiers,
Unique Identifiers, Attributes, Descriptions.
Note: See the Display Level box on the
toolbar (also View menu | Display Level).

Gradient
Effect

Displays gradient effect in LER model.

Display
Domain

Displays domains in entity.

To define colors for attributes on your Workspace
»

Select Settings | Options | Model section | Logical Model | Entity tab | Attribute
Colors area.

293

Toad Data Modeler User Guide
Projects and Models

Related Topics
Format Objects (page 62)
Entities
Edit Entities
»

Double-click the entity on the Workspace.
or
Edit the entity in Model Explorer | Entities folder | double-click the selected
entity (or right-click | Edit).

Note: You can also edit entities in the Entities dialog (Model menu | Model Items |
Entities | Edit).

Option

Description

Object
Navigator Box

All entities of your logical model are listed here. It
allows you to edit entities quickly and comfortably
from one place.
Tip: After you finish editing an entity, click Apply to
confirm changes and select another entity from the
Object Navigator box.

General Tab

Description

Caption

Logical name of entity

Name

Physical name of entity

Category

Category selection box. To see/add/edit categories of
your model, click the small button on the right.

Size

Definition of supposed table size. Toad Data Modeler
also converts defined values to physical model.

Nature

Definition of table nature (Logical information).
Select existing value from the box or write a new
value.

Logical Only

Select this checkbox not to convert the entity to
physical model during LER to PER conversion.

Attributes Tab

On this tab, you can add, edit and delete attributes of
the entity.

294

Toad Data Modeler User Guide
Projects and Models

Option

Description

Unique
Identifiers
Tab

On this tab, you can manage unique identifiers. A
unique identifier has been created by default.

Description
Tab

Write description on the entity on this tab. You can
display the description in your logical ER diagram see the Descriptions option in the Display Level box.

To Do Tab

On this tab, you can write some tasks on the selected
entity.

Note: Working with attributes and unique identifiers
in logical model is similar to working with attributes
and primary keys in physical model. More details on
the operations can be found in appropriate sections of
the "Physical Data Model" chapter.

Note: To see all To Do tasks, select Model | To Do.

Related Topics
Inplace Editor (page 46)
Object Navigator Box (page 402)
Features (page 374)

295

Toad Data Modeler User Guide
Projects and Models

Entity Right-Click Options in Logical Model

Option

Description

Format...

Opens the Object Format dialog for selected entity.

Add into
Workspace...

Opens the Workspaces dialog where you can select a
WS to add the entity to.

Add into New
Workspace

Creates a new Workspace in the Application
Window and adds the entity to it.

Remove from
Workspace

Removes the selected shortcut from particular
Workspace.

Delete Object

Deletes the selected entity from model.

Arrange
Arranges the entity in another layer.
See "Arrange Objects in Layers" (page 336) for more
information.
Add Object to
Gallery

Adds object to new or selected Gallery.

296

Toad Data Modeler User Guide

297

Projects and Models

Option

Description

Recalculate
Size

Adjusts the entity size to the length of its columns.

Align Self
Relationship

Aligns self relationship.

Edit

Opens the Entity Properties form.

Add

Adds new object (Attribute, Unique Identifier
Attribute or empty Unique Identifier)

Edit Attribute...

Opens the Attribute Properties form. This option is
active only if attribute is selected in the diagram.

Add to
Category

Adds object to selected Category.

Attributes
Create Attributes
To create an attribute in LER model
»

Double-click an entity on the Workspace to open the Entity Properties form | Attributes
tab | Add.
or
Model Explorer | Entities folder | Unfold the selected entity. | Right-click the
Attributes item. | Add Attribute.

Option/Column

Description

Ident.

Graphical representation of unique identifier of
particular attributes

Caption

Logical attribute name

Name

Physical attribute name

Data Type

Data Type of an attribute

Mandatory

The Mandatory selection box

Toad Data Modeler User Guide
Projects and Models

Option/Column

Description

Status

See "Status of Items in Grids" (page 47) for more
information.

Buttons:
- opens the Application Variables form
Add - adds an attribute
Edit - opens the Attribute Properties dialog
Delete - deletes selected attribute

- changes position of selected attribute - up and down

Related Topics
PER - LER Conversion Information (page 428)
Edit Attributes
»

In the Entity Properties dialog | Attributes tab, double-click the selected attribute.
or
Find the attribute in Model Explorer | EntityName folder | Attributes | Doubleclick the selected attribute.

298

Toad Data Modeler User Guide
Projects and Models

Option

Description
Above the Object Navigator Box, you can see name
of entity that the attribute belongs to. Click the
button on top right-hand corner to open the parent
form (Entity Properties form).

Object
Navigator Box

All attributes of selected entity are listed here. The
box allows you to edit attributes quickly and
comfortably from one place.

General Tab

Description

Caption

Logical attribute name

Name

Physical attribute name

299

Toad Data Modeler User Guide
Projects and Models

Option

Description

Data Type

Data Type selection box

Domain

Domain selection box.
Note: It's not possible to assign a data type and a
domain to an attribute at the same time. If you select a
domain, appropriate data type will be set
automatically from the domain.

Default Rule

Default selection box. Defaults are converted to
physical model also.

Logical Only

Select this checkbox not to convert the attribute to
physical model during LER to PER conversion.

Mandatory

Mandatory items will be displayed as Not Null
attributes in physical model.

Rules Tab

A tab where you assign rules to the attribute. Rules
are used for the generation of Rules in physical model
and later for Check Constraints in the generated SQL
code (generated from physical model). In Rules, check
constraints for multiple columns can be defined, for
example.

Valid Values
Tab

Valid values can be defined for the following data
types:
l

Bigint

l

Float

l

Integer

l

Char

l

VarChar

Valid values are used for generation of simple check
constraints.
Valid values can be defined as Enumeration (for
VarChar data type, for Example) or as a Range (for
Integer data type.)
As soon as you add a new Enumeration, the in-place
editor in the Enumeration box will activate
automatically.
Note: In Toad Data Modeler 3.x, valid values in LER
model = check constraints in PER model (feel free to
check out the conversion).

300

Toad Data Modeler User Guide

301

Projects and Models

Option

Description
If the Valid Values tab is not available (depends on
the selected data type), you can use rules (see the
Rules tab).
A tab for description notes on the attribute.

Description
Tab

Related Topics
Inplace Editor (page 46)
Object Navigator Box (page 402)
Unique Identifiers
Edit Unique Identifiers
To add or edit the unique identifier
»

Open the Entity Properties dialog | Unique Identifiers tab | double-click the unique
identifier.
or
Find the unique identifier in Model Explorer | EntityName folder | Unique
Identifiers | Double-click or right-click it and select Edit.

To assign unique identifier to attribute
1. Click the Attributes tab in the Unique Identifier Properties dialog and select an attribute
(attributes).

2. Click

to shift the selected attribute(s) to the section Selected.

3. Confirm OK.

Option

Description

Object
Navigator
Box

The combo- box allows you to edit unique identifiers
quickly and comfortably from one place.

Toad Data Modeler User Guide

302

Projects and Models

Option

Description

General
Tab

Description

Caption

Logical unique identifier name

Name

Physical unique identifier name

Attributes
Tab
Available

A list of all attributes of the entity

Selected

Attribute(s) that have been assigned the unique identifier.
Adds selected item(s).

Puts back selected item(s).

Adds all items.

Puts back all items.

Select Linking Method
To select a unique identifier before the LER - PER model conversion
1. Edit the selected relationship and click the General tab.
2. From the Foreign Unique Identifier box, select the identifier that will be used during
LER to PER conversion.
Note: For inversed relationships, you can select it from the Opposite Foreign
Unique Identifier box.

Toad Data Modeler User Guide
Projects and Models

Related Topics
Conversion to Physical Model (page 310)
Migration of Keys
Relationships
Edit Relationships
Logical model supports the following relationship types:
l

Identifying relationship

l

Non-identifying relationship

l

Self-relationship (identifying as well as non-identifying)

l

M:N relationship (See "M:N RelationshipsLER and PER models both support M:N
relationships. See below how they are converted. LER ModelPER Model (After

303

Toad Data Modeler User Guide

304

Projects and Models

Conversion) Related TopicsMigration of KeysPER - LER Conversion Information" (page
1) for more information
To edit a relationship
»

Double-click the relationship on the Workspace. 
or
Edit the relationship in Model Explorer | Relationships folder | double-click the
selected relationship (or right-click | Edit).

Note: You can also edit relationship in the Relationships dialog (Model menu |
Relationships | Edit).

Option

Description

Object Navigator
Box

All relationships of your logical model are listed
here. Edit relationships quickly and comfortably
from one place.
Tip: After you finish editing a relationship, click

Toad Data Modeler User Guide
Projects and Models

Option

Description
Apply to confirm changes and select another
relationship from the Object Navigator box.

General Tab

Description

Caption

Logical name of relationship

Name

Physical name of relationship

Foreign Unique
Identifier

Select the linking method for the relationship.
According to your selection, the LER model will
be converted to PER model. See Migration of Keys
for more information.

Opposite Foreign
Unique Identifier

Select the linking method for the inversed
relationship.

Logical only

Select this checkbox not to convert the relationship
to physical model during LER to PER conversion.

305

Toad Data Modeler User Guide

306

Projects and Models

Cardinality
Tab

Define the cardinality.
Left Side:
Dependency - definition of dependency
Mandatory - definition of mandatory item on the left
side
Exactly - definition of the lower cardinality range limit
Dominant - definition of a would- be parent for
conversion to PER on the left side (if active and not
defined otherwise)
One - definition of one to many or many to many
relationship
Many - definition of one to many or many to many
relationship
X - definition of the higher cardinality range limit
Right Side:
Dependency - definition of dependency
Mandatory - definition of mandatory item on the right
side
Exactly - definition of the lower cardinality range limit
Dominant - definition of a would- be parent for
conversion to PER on the right side (if active and not
defined otherwise)
One - definition of one to many or many to many
relationship
Many - definition of one to many or many to many
relationship
X - definition of the higher cardinality range limit

Description
Tab

Tab for description notes on the relationship.

To Do Tab

On this tab, you can write some tasks on the selected
relationship.
Note: To see all To Do tasks, select Model | To Do.

Keys do NOT migrate in Logical models, but only in Physical models. In Logical model,
only logical information is available. The relationships have only a logical meaning
(therefore keys do not migrate). However, in Physical model the information on foreign keys
is necessary. Therefore when you convert the Logical model to Physical model, FKs will be
displayed properly in the physical model. It is done automatically and there is not any way
to avoid doing this automatically.

Toad Data Modeler User Guide

307

Projects and Models

Related Topics
PER - LER Conversion Information (page 428)
M:N RelationshipsLER and PER models both support M:N relationships. See below how they
are converted. LER ModelPER Model (After Conversion) Related TopicsMigration of KeysPER LER Conversion Information (page 1)
Inheritance
Create Inheritances
1. Click

on the toolbar (also CTRL+I)

Tip: You can also create inheritance in the Objects menu | Add New |
Inheritance.
2. Move your mouse cursor over the work area and click the parent entity and then the
target entity (child).
Tips:
l

While creating an inheritance, you can add handle points at the same time. Click the
parent entity and then click the work area as many times as many handle points you want
to create. Finally click the child entity.

l

Make horizontal and vertical inheritance lines:
1. Select an inheritance and click the parent entity.
2. Press SHIFT and hold the key down, click the parent entity. - Now only vertical
and horizontal lines will be offered to you wherever you move your mouse cursor.
(Click the work area to create some handle points.)
3. Finally, click the child entity.

l

Create several Children of the existing inheritance:
1. Click the Inheritance icon

on the toolbar.

2. Click the inheritance in the model.
3. Click another entity in the model.

Related Topics
a) Single Table - Parent Inherits All Children (page 313)
PER - LER Conversion Information (page 428)
Edit Inheritances
»

Double-click the inheritance on the Workspace.

Toad Data Modeler User Guide
Projects and Models

or
Edit the inheritance in Model Explorer | Inheritances folder | double-click the
selected inheritance (or right-click | Edit).
Note: You can also edit inheritances in the Inheritances dialog (Model menu |
Inheritances | Edit).

Option

Description

Object
Navigator
Box

All inheritances of your model are listed here. It allows
you to edit inheritances quickly and comfortably from
one place.

General Tab

Description

Caption

Logical name of inheritance

Name

Physical name of inheritance

Parent

Name of the parent entity

Logical Only

Select this checkbox not to convert the inheritance to
physical model during LER to PER conversion.

Exclusive

Definition of exclusive inheritance.

308

Toad Data Modeler User Guide
Projects and Models

Option

Description
For exclusive inheritances, Toad Data Modeler
generates triggers that will perform a check whether a
correct record in siblings exists or not, and decide
whether a record can be added to table or not etc.
Exclusive inheritances are displayed with cross in the
middle of the graphics:

Standard inheritances don't have the cross inside the
graphics:

Complete

Logical information only. The information says that all
records must be complete.

Generation
Tab

On this tab, select how you want to convert inheritance
during conversion of logical model to physical model.
See "a) Single Table - Parent Inherits All Children"
(page 313) for more information.

Descendents
Tab

Description

Name

Name of descendent

Discriminator
Valid Value

Valid values of Discriminator

Edit
Discriminator

Opens the Valid Values dialog for the selected
Discriminator.

To Do Tab

On this tab, you can write some tasks on the selected
inheritance.
Note: To see all To Do tasks, select Model | To Do.

Description
Tab

Related Topics

Tab for description notes on inheritance.

309

Toad Data Modeler User Guide

310

Projects and Models

a) Single Table - Parent Inherits All Children (page 313)
PER - LER Conversion Information (page 428)
Conversion to Physical Model
Convert Logical Model to Physical Model
Toad Data Modeler allows you to convert your logical model to a physical model of any
supported database system.
»

Click Model | Convert... to open Sync & Convert Wizard.

See "Sync & Convert Wizard" (page 438) for more information.
See "Simple Model Conversion" (page 434) for more information.
Before you convert your LER model to PER model, you should know particularly the following
information:
l

Physical model supports only non-identifying self relationship.

l

Inheritance is not supported in PER model.

l

Keys in LER models do not migrate.

l

You can select a linking method in LER model.

l

M:N relationships are supported in both models.

l

Before you start the conversion, you can set up the conversion rules in the Data Type
Conversion Settings dialog.
Note: This option is available only if Expert Mode is enabled.

Please follow other topics in this chapter to learn more.
Notes:
1. WS format changes during LER - PER conversion: If the WS format settings in LER
model differ from default settings defined in the Settings menu | Options | Logical
Model, the WS format settings of particular workspace in LER model will be transferred
to the new PER model.
If the WS format settings in LER model correspond with default settings defined in the
Settings menu | Options | Logical Model, the new PER model will have take over the
default settings defined for PER models in the Settings menu | Options | Physical Model.
2. Cycled relationships during LER to PER conversion: Cycled relationships will be ignored
during LER to PER conversion and will not be converted. A message informing about
this will be written in Message Explorer.

Related Topics

Toad Data Modeler User Guide

311

Projects and Models

Data Types Conversion (page 311)
PER - LER Conversion Information (page 428)
Data Types Conversion
To define rules for data type conversion
»

Select Expert Mode | Expert Mode Settings | Data Type Conversion Settings. See "Data
Type Conversion Settings" (page 422) for more information.
Note: This option is available only if Expert Mode is enabled.

Related Topics
M:N RelationshipsLER and PER models both support M:N relationships. See below how they
are converted. LER ModelPER Model (After Conversion) Related TopicsMigration of KeysPER LER Conversion Information (page 1)
PER - LER Conversion Information (page 428)
M:N Relationships
LER and PER models both support M:N relationships. See below how they are converted.
LER Model

Toad Data Modeler User Guide

312

Projects and Models

PER Model (After Conversion)

Related Topics
Migration of Keys
PER - LER Conversion Information (page 428)
Inheritance
Inheritance is not supported in Physical Model. Therefore, before you convert your LER model,
you need to set up how you want to implement inheritance to PER model. See the following
example of inheritance.

Toad Data Modeler User Guide
Projects and Models

1. Double-click the inheritance and select Generation tab.
2. In the Physical Implementation area, select any of available options:

a) Single Table - Parent Inherits All Children
The conversion output is the following:

313

Toad Data Modeler User Guide
Projects and Models

b) N - 1 - Each Child Inherits the Parent
The conversion output is the following:

c) N Tables - Physical Model Matches Logical
The conversion output is the following:

314

Toad Data Modeler User Guide

315

Projects and Models

Notes on Conversion of Inheritance:
l

Single Table Generation (Parent Inherits All Children), Discriminator for Child
Entities is Set - After the conversion, a check constraint will be created in parent entity in
PER model. This check constraint determines conditions for setting Not Null value of
attributes taking into account options set up in Discriminator.

l

Inheritance Exclusive, N - 1 Generation (Each Child Inherits the Parent) - During the
conversion, all attributes of parent entity will be passed to child entities and triggers will
be created in the child entities. These triggers determine creation of new items in child
entities. - Rule: it is not possible that two child entities with the same key of parent
entity would exist.

l

N Tables Generation (Physical Model Matches Logical) - Instead of inheritance,
relationship (identifying by default) will be created between parent and child entities
in PER model.

l

Inheritance conversion - Relationship names are made unique in physical model. 
o

N - 1 Tables - Each Child Inherits the Parent: Relationship name_number
(e.g. Relationship1_1, Relationship1_2)

o

N Tables - Physical Model Matches Logical: Parent Entity Name_Child
Entity Name

Related Topics
Conversion (page 316)
PER - LER Conversion Information (page 428)

Toad Data Modeler User Guide

316

Projects and Models

Conversion

Scenario
You want to convert Logical model Employee to PER model for Oracle
10g. Use the Sync & Convert Wizard. Model Employee is open and
active.

Scenario: Select a method for inheritance conversion.
1. Edit inheritance and define the physical implementation options in the logical model.
Select the Single Table - Parent Inherits All Children option.
2. Click

on the toolbar to open the Sync & Convert Wizard.

3. On the Action page, select Convert Model to Another Target Database System.
4. On the Select Left Side page, Available Model box, select the logical model Employee.
5. On the Select Right Side page, select a target database system Oracle 10g.
6. On the Settings page, select Comment Out Database Specific Items and Log Progress to
File - to save the messages that the Wizard returns to a file.
7. On the Select Object Types page, select Convert All.
8. On the Select Items page, leave the default selection to convert all items of the model.
9. On the Review page, see the statistic information and define a model name for the
converted model in the New Model Name box - Employee_ConvertedLER.
10. Click Finish.

Toad Data Modeler User Guide

317

Projects and Models

11. The Sync & Convert Wizard closes and the new model Employee_ConvertedLER opens
in the Application Window automatically.
See the result:

Related Topics
PER - LER Conversion Information (page 428)
Sync & Convert Wizard (page 438)
Simple Model Conversion (page 434)
Defaults
Defaults
To add a default
»

Select Model | Model Items | Defaults and click Add in the Defaults dialog.
Tip: You can also add a default in the Model Explorer | Right-click the Defaults
folder | Add Default.

To edit a default
»

Select Model |Model Items | Defaults and double-click the selected default or click Edit.
Tip: You can also edit/rename/delete defaults in Model Explorer | Defaults
folder | Right-click the selected default.

To select a default for attributes
1. Open the Attribute Properties dialog of the selected attribute | General tab.
2. From the Default Rule box, select a default or write your own default to the Default box.

Toad Data Modeler User Guide
Projects and Models

Note: You can define defaults for domains too.
To delete defaults
»

Select Model | Model Items |Defaults | select a default and click Delete.

Related Topics
PER - LER Conversion Information (page 428)
Rules
Rules
To add a rule
»

Select Model | Model Items |Rules  and click Add in the Rules dialog.
Tip: You can also add a rule in the Model Explorer | Right-click the Rules
folder | Add Rule.

To edit a rule
»

Select Model |Model Items | Rules and double-click the selected rule or click Edit.
Tip: You can also edit/rename/delete rules in Model Explorer | Rules folder |
Right-click the selected rule.

To select a rule for attributes
1. Open the Attribute Properties dialog of the selected attribute | Rules tab.
2. Select a rule and click the Add arrow button.
Note: You can define rules for domains too.
To delete rules
»

Select Model | Model Items |Rules | select a rule and click Delete.

Related Topics
PER - LER Conversion Information (page 428)

318

Toad Data Modeler User Guide

319

Projects and Models

Reports
Report Generation
HTML, RTF and PDF Reports
Toad Data Modeler allows you to generate detailed documentation to your physical and logical
models in HTML, RTF or PDF format.
For metamodels, you can generate only HTML reports.
All the settings you set up for your report generation are saved with the model.
Tip: For your physical models, Toad Data Modeler allows you to generate also alter reports
(HTML, RTF and PDF). See "Model CompareCompare Models, Alter ReportsToad Data Modeler
allows you to view differences between two models and for physical models you can generate
alter reports in HTML, RTF and PDF formats. Alter reports are not available in logical
models.Example: You want to compare Oracle 10g models Videorental_Original and
Videorental_Modified and generate HTML alter report for the differences.Note: Please read the
User Guide for solution to this example of alter report generation. You can compare your models
and generate the alter report via the Sync & Convert Wizard.To compare models and generate the
alter report Click on the toolbar.On the Action page, select Compare Models and Generate Alter
Report.Go through other pages of the wizard.See Sync & Convert Wizard for more information
on the wizard. Sync & Convert Wizard, Select Items PageOn the Select Items page, you can see
differences between the models. The differences will be generated in the alter
report.OptionDescriptionGo to Previous DifferenceGo to Next DifferenceExpand AllCollapse
AllGenerate Alter ReportNote: Click this icon to generate the report, or click the button Report
at the bottom of the page.Display options for objectsDisplay options for propertiesModel 1The
model selected on page Select Left Side of the wizard. It is the updated or modified model.Model
2The model selected on page Select Right Side of the wizard. It is the older version of the
model.Diff.Column showing the type of difference: This icon and the blue color say: "There is a
difference." This icon and the green color say: "This item exists in Left model (Model 1) and is
missing in Right model (Model 2)." This icon and the red color say: "This item is missing in Left
model (Model 1) and exists in Right model (Model 2)." To generate the alter reportClick on page
Select Items of the Sync & Convert Wizard. The Report Wizard opens. You can close the Sync &
Convert Wizard.Go through the steps in the Report Wizard (same as during standard report
generation).Note: The Options page of the Report Wizard for the alter report is empty for
now.Finally click Execute and Show to display the alter report. Related TopicsSync & Convert
WizardHTML, RTF and PDF Reports" (page 1) for more information.
To generate an HTML, RTF or PDF report
1. Click

on the toolbar (or select Model | Generate Report | Report Wizard...).

2. On the Select Format page, select the report format - HTML, RTF or PDF.
3. On the Select Report Type page, select a report type and a language in which you want
to generate the report.

Toad Data Modeler User Guide

320

Projects and Models

You need to download appropriate packages for your language from the
Modeling community website.
4. On the Select File page, define a path where you want to generate the report.
Note: The default path can be set up in the Settings menu | Options | Application
| Paths | Reports | Path to HTML/RTF/PDF Reports.
5. On the Select Layout page, select a frame and style of your report.

Select Layout
Page
Report Layout

Description

l

Frameless (for Internet Explorer 7
and FireFox 2 users. Reports with
Frameless layout is not displayed in
older browsers correctly.)

l

Frames - Top menu

l

Frames - Left menu

Note: For large models, Frames - top menu
or Frames - left menu options are
recommended. (Frameless report layout is
not recommended as it uses Java script that
goes through all objects, which takes too

Toad Data Modeler User Guide

321

Projects and Models

Select Layout
Page

Description

much time if your model is large.)
Options for RTF and PDF report:

CSS Style

l

Frames Drawing

l

Cells Shadow

l

Watermark area (No Watermark,
Insert Image Watermark, Insert Text
Watermark)

Available styles for HTML report:
l

Default

l

Others (select the most convenient
to you)

Close Wizard
after
Execution

Closes the wizard automatically after the
process is finished.

Previous

Goes back.

Next

Goes ahead.

Show Log

Displays/hides Log area in the wizard.

Cancel

Cancels the report generation process.

Log Area

Displays
messages
generation process.

during

report

6. On the What to Report page, select Object Types and Properties you want to work with.
See "Object Types and Properties - OTPs " (page 406) for more information.
See "Object Types and Properties - OTPs " (page 406) for more information.
7. On the Options page, select options for your report. The options are specific for each
report format and type.
l

To generate a report for the whole model, including images of all
Workspaces of the model, select All Workspaces from the Select
Workspace box. (The Generate All Model Objects checkbox is selected
automatically.)

Toad Data Modeler User Guide

322

Projects and Models

l

To generate a report for the whole model but only an ERD image of
particular Workspace, select the Workspace from the Select Workspace
box and select the Generate All Model Objects checkbox.

l

To generate a report for particular Workspace, select the Workspace
from the Select Workspace box and clear the Generate All Model
Objects checkbox.
Note: ERD image of the selected workspace plus only objects that
exist on the workspace will be generated in the report (e.g. tables,
relationships, views etc.). The report will also contain all model
objects that cannot be placed on Workspaces (e.g. User Data Types,
Procedures etc.).

l

In RTF and PDF reports, there is the Use References Inside Report
checkbox on page Options. Select this checkbox to use references in the
generated report.
Note: If you open the report in MS Word, we recommend to press
CTRL+A to select all text and right-click | Update Field. Then
CTRL+click to follow the link.

8. Click Execute. To see the generation process, select the Show Log checkbox.
9. As soon as the report generation is finished, the following message will be displayed in
the Wizard: 'Report has been generated.' Now click Show to see the final report.
10. Click Cancel or x to close the Report Wizard.
Tip: Leave checkbox Close Wizard after Execution cleared if you want to
generate another report - with new options, another style etc. Click Previous to
get back to previous steps to define new report options.
Notes:
1. HTML Reports: After you generate the new report and your previous report has remained
open, press Refresh F5 to update it.
2. RTF Reports: If you want to generate another RTF report, remember to close the previous
report first!
3. Both HTML and RTF reports are saved in UTF-8 encoding.

Toad Data Modeler User Guide

323

Projects and Models

Related Topics
Model CompareCompare Models, Alter ReportsToad Data Modeler allows you to view
differences between two models and for physical models you can generate alter reports in HTML,
RTF and PDF formats. Alter reports are not available in logical models.Example: You want to
compare Oracle 10g models Videorental_Original and Videorental_Modified and generate
HTML alter report for the differences.Note: Please read the User Guide for solution to this
example of alter report generation. You can compare your models and generate the alter report
via the Sync & Convert Wizard.To compare models and generate the alter report Click on the
toolbar.On the Action page, select Compare Models and Generate Alter Report.Go through other
pages of the wizard.See Sync & Convert Wizard for more information on the wizard. Sync &
Convert Wizard, Select Items PageOn the Select Items page, you can see differences between the
models. The differences will be generated in the alter report.OptionDescriptionGo to Previous
DifferenceGo to Next DifferenceExpand AllCollapse AllGenerate Alter ReportNote: Click this
icon to generate the report, or click the button Report at the bottom of the page.Display options
for objectsDisplay options for propertiesModel 1The model selected on page Select Left Side of
the wizard. It is the updated or modified model.Model 2The model selected on page Select Right
Side of the wizard. It is the older version of the model.Diff.Column showing the type of
difference: This icon and the blue color say: "There is a difference." This icon and the green
color say: "This item exists in Left model (Model 1) and is missing in Right model (Model 2)."
This icon and the red color say: "This item is missing in Left model (Model 1) and exists in
Right model (Model 2)." To generate the alter reportClick on page Select Items of the Sync &
Convert Wizard. The Report Wizard opens. You can close the Sync & Convert Wizard.Go
through the steps in the Report Wizard (same as during standard report generation).Note: The

Toad Data Modeler User Guide

324

Projects and Models

Options page of the Report Wizard for the alter report is empty for now.Finally click Execute
and Show to display the alter report. Related TopicsSync & Convert WizardHTML, RTF and
PDF Reports (page 1)
XSL Transformation (page 324)
XSL Transformation
This feature allows you to create user outputs for your physical models very fast. The output can
be in any format that supports XSL language - e.g. HTML, PDF, CSV, text or XML.
You select among various XSL templates. Each template generates a different output (HTML,
CSV etc.) Advanced users can customize the templates and modify their content to generate an
output that will fit their needs.
You can generate the following reports or outputs:
l

Comments (HTML)

l

Complete XML (XML)

l

Entities (CSV)

l

Notes (HTML)

l

Tablespaces (HTML)

l

To Do Report (HTML)

To generate any of the outputs
»

Select Model | Reports / XSL Transformation.

Option

Description

XSL Template
Name

Shows types of various XSL templates that you
can select.

Output File

Path where the output file will be saved. It
corresponds with the path defined in Settings |
Options | Paths | Reports.

Template
Description

Gives information on the selected template.

More>>

Shows/hides options for advanced users interested
in customization of the templates.

XSL File Location

Path where appropriate system template is stored.
System templates shouldn't be modified. Via the
button on the right, you can add other templates
you created and that are missing in the box XSL
Template Name.

Toad Data Modeler User Guide

325

Projects and Models

Option

Description

Input Values

In this area, templates with parameters are
displayed. You can edit them directly here.

Save XSD File As

Allows you to save the XSD file without the
necessity to open it in associated application.

Show XSD File

Shows the XSD file. The XSD file describes
structure of source XML that is an input for XSL
transformation.

Transform

Starts the process of transformation.

View

Shows the result.

Notes:
1. More information on XSL templates and details on how to customize XSLT templates can
be found in User Guide.
2. Some XSL templates are available in the Modeling community.

Customize XSLT Templates
XSLT is an XML based language used for transformation of XML source documents into other
documents. Output files can be XML, HTML, TXT, CSV, SVG, XSD and so on.
In general, for transformation of XML files it is necessary to specify:
1. Source (XML)
2. Template with instructions on how to convert a source to ouput (XSLT file)
3. Output file (where to store the output)
Toad Data Modeler allows you to transform simplified XML structure to the selected output. The
simplified XML contains less XML data than standard TXP files (TXP is a standard file suffix for
Toad Data Modeler models, however, its structure is also XML.)
Where to Find the Simplified XML File?
You cannot find it. You must generate it. Every database system contains different items
(sequences...), that's why also simplified XML structures for MySQL and Oracle may differ.
To generate XML file
1. Click Model | Generate Report | XSL Transformation and from the XSL Template
Name box select Complete XML (XML).

Toad Data Modeler User Guide

326

Projects and Models

2. Click Transform and View to open the generated simplified XML file for your database
model. You will see a structure of XML file and a content of your model, including
entity names, attribute names, information about relationships, comments etc.

Toad Data Modeler User Guide

327

Projects and Models

For creation of new XSL templates, it is useful to work with XSD files. XSD files describe
structure of XML source file and helps you to understand the XML structure, what nodes may
appear in XML and so on. You can click Show XSD File or Save XSD File As to display or
save XSD file for your simplified XML structure.
Predefined XSL Templates
By default, the following reports or outputs can be generated:
l

Comments (HTML)

l

Complete XML (XML)

l

Entities (CSV)

l

Notes (HTML)

l

Tablespaces (HTML)

l

ToDo Report (HTML)

Using these predefined items you can generate report of all ToDo items, create CSV files with
information about entity names, captions and descriptions etc.
Path to XSLT files
There are two folders where XSLT files are stored.

Toad Data Modeler User Guide

328

Projects and Models

1. System folder: C:\Program Files\Quest Software\Toad Data Modeler 3\XSL
2. User-defined files: C:\Documents and Settings\<user name>\My Documents\Toad Data
Modeler\<installation name>\XSL
Sample XSLT File

Special instructions, parameters
In all XSLT files there must be the following special instructions:

If you want to create a template only for selected target databases, use the following:

Parameters specified this way:

will display in the Input Values table of the XSL Transformation dialog.

Toad Data Modeler User Guide

329

Projects and Models

Edit Existing XSLT Templates
1. Copy the system XSLT template to your user section. Default locations are:
System: C:\Program Files\Quest Software\Toad Data Modeler 5.0\XSL
User: C:\Documents and Settings\<user name>\My Documents\Toad Data
Modeler\<installation name>\XSL
2. Edit the code then.
Tips:
l

Visit the Modeling community for other available XSL templates.

l

Read tutorials on customization on our weblog.

Print
Page Format
1. Click

on the toolbar (or select File | Page Setup)

2. Select page size, margins, orientation etc.
To define the page size on your own, select Custom from the Page box. Define Height
and Width on the right.
Tip: The measure unit can be set up in Settings | Options | General | Select Unit
of Length - inches or millimeters.
Option

Description

Fit to Page

Select this option to print the
entire model on one page. This
option is model-dependent.

Enlarge

Select a scale of your model for
print.

Portrait/Landscape

The option selected in the Page
Format
dialog
will
be
automatically set up in the
Printer Properties dialog. You
can set up a different orientation
for every model, the option is

Toad Data Modeler User Guide

330

Projects and Models

Option

Description
model-dependent.

Printer

Select your printer.
Then in the Page box you can see
formats that the selected printer
supports (enabled items) and other
formats (disabled items). (This
feature should solve problem with
printing on plotters.)

Note: Page Format settings are saved with a model.

Related Topics
Export to Graphic File (page 331)
Print (page 331)
Preview
»

Click

Option

on the toolbar (or select File | Preview).
Description
Shift among pages.
Page number/total number of pages
Scale percentage

Opens the Print Setup dialog.
Displays/hides all pages on the left side of the dialog.
 Exits the dialog.

Related Topics

Toad Data Modeler User Guide

331

Projects and Models

Print (page 331)
Print (page 329)
Print
Tips before You Print
l

To set up size of the pages, select File | Page Setup. To customize the page size, see the
Page Setup dialog | Scale area | and from the Page box, select Custom. Define Height
and Width on the right.

l

To print your ER diagram on one page, select File | Page Setup | select the Fit to
Page checkbox.

l

Turn off the display of page boundaries - select Settings | Options | Graphics | clear the
Visible Page Boundaries checkbox.

l

In Settings | Options | General, clear the Print Gradients checkbox for much faster print
performance. (It is disabled by default.)

l

Turn off page numbering and a frame around your ER diagram - select File | Print |
Settings tab | clear the Print Frame and Print Page Number checkboxes.

To print you model
1. Click

on the toolbar (or select File | Print).

2. Select appropriate printer and click Properties for other configuration.
3. On tab Settings, select from the available options.

Notes:
l

You may try to print to PDF using "PDF printer". (Not all PDF printers are supported.)

l

Print on plotter - we recommend to print your ER diagram to PDF format first.

l

Problem during print on virtual printer - The problem occurs only in case of print from
local machine (all printers from local machine are visible on vWorkspace). If the virtual
printer is installed on vWorkspace directly, the problem doesn't occur.

Related Topics
Print (page 329)
Export to Graphic File (page 331)
Export to Graphic File
In Toad Data Modeler, you can export your model into the following graphical formats:

Toad Data Modeler User Guide
Projects and Models

l

BMP

l

JPEG

l

PNG

To export your ER diagram to a graphic file
1. Select File | Export to Image....
2. Define options on tab Settings, including a file where you want to save the output.
Option

Description

File Type

Select a graphical format.

Color

Colors the output.

Pages

Divides the output image into several pages.

Paint Frame
of Pages

Paints a frame of pages.

Scale

Size of the output in percentage scale (Initial
value is 100 per cent.)

Width

It changes automatically according to the set
up percentage scale.

Height

It changes automatically according to the set
up percentage scale.

Margin

Set Margin for the exported graphics.
By default this value is 0 = No margins.
Value 250 = 1 inch = 25 mm

Destination
File

Path to the file (where the output will be
saved). By default, the output is stored in the
BIN directory of Toad Data Modeler, e.g.
C:\Program Files\Quest Software\Toad Data
Modeler\Bin\export.bmp.

Open Folder
After Export

When checked, the folder with the exported
graphics is opened after export.

3. Define other settings specific for the selected graphical format on other tabs.
Note: Large images cannot be exported into JPG. Generate PNG files instead of JPG if you
expect the image size to be more than 2 MB.

332

Toad Data Modeler User Guide

333

Projects and Models

Graphics
Autolayout
There are three autolayouts available in Toad Data Modeler.

1. Top to Bottom
2. Left to Right
3. Alphabetic
To re-arrange objects on your Workspace automatically
»

Click one of the three first icons on the Layout toolbar.
Note: These options are also available from the Layout menu.

You can use the Autolayout function particularly after:
l

Reverse engineering

l

The Add All Model Objects to Workspace option - when you add shortcuts of objects to
your new Workspace.

Tip: To set up a coefficient of distance between tables on the Workspace, select Settings |
Options | Graphics | Autolayout area. (The lower the coefficient is, the smaller the distance
between tables will be.)

Related Topics
Arrange Objects in Layers (page 336)
Create ShortcutsToad Data Modeler allows you to create shortcuts of objects on Workspaces in
many ways and also from Model Explorer to a particular Workspace. See the following
options.To add a shortcut within a WorkspaceDrag&Drop techniques and CTRL+SHIFTThis
cannot be used for creating shortcuts of relationships and inheritance.Example:Create a shortcut
of the Customer entity on one WS - Borrowing WS:Click the Customer entity on the Borrowing
WS and hold the mouse key down.Press CTRL+SHIFT keys and hold them down.Drag the
Customer entity to any place on the work area (the mouse cursor will change its
appearance).Release the mouse button and then the keys. To add a shortcut from Model Explorer
to WorkspaceDrag&Drop techniques from Model Explorer to particular WSExample:Activate the
Workspace where you want to add a shortcut of the Customer entity.In Model Explorer, find the
Customer entity.Click the Customer entity and hold the mouse key down.Drag the Customer
entity to the WS (the mouse cursor will change its appearance).Release the mouse button and
then the keys.Tip: Have a look at the Shortcuts folder of the Customer entity in Model Explorer.

Toad Data Modeler User Guide

334

Projects and Models

A new shortcut has been created.  To add a shortcut of the selected object(s) from one
Workspace to another WorkspaceRight-click the selected object(s) (e.g. entity) on the WS and
select: Add into Workspace to select the particular WS.orAdd into New Workspace to create a
new WS and add the shortcut there. The layout and format of the shortcuts remain preserved
when you use this option. To add a shortcut of related objects to particular entity on the
Workspace (including relationships)Right-click the entity and select from the following
options:Fill Parent Objects to add shortcuts of parent objects of the selected entity to the WS.Fill
Child Objects to add shortcuts of child objects of the selected entity to the WS.Fill Parent and
Child Objects to add shortcuts of parent and child objects of the selected entity to the WS. To
add a shortcut of object(s) to the selected WorkspaceRight-click the selected Workspace and
select:Add All Model Objects to Workspace to add shortcuts of all objects that exist in your
model.orAdd Selected Objects to Workspace to select shortcuts of those entities that are not
contained on the WS, and of those relationships/inheritances that are possible to create on this
WS. Related TopicsEdit Shortcuts (page 1)Shortcut Right-Click Options in Model Explorer (page
1) (page 1)
MacrosMacrosToad Data Modeler supports macros. You can use sample macros available in the
Macros menu or create your own macros. You can create a macro in Package Explorer or Script
Explorer and modify its properties to display the macro either in the main menu or pop-up menu
(of particular object or on the Workspace etc.). Visual components for creation of macros are also
available (User Forms).To see or use the available sample macrosSelect Macros | All.Sample
macros:Convert Names to Lower CaseConvert Names to Upper CaseInfer Relationship - Macro
for automatic creation of relationships between identically named columns.Alphabetic
Autolayout - See Autolayout for more information.The selected macro will be applied on all
objects on all Workspaces of the model or all objects of the active Workspace. Select Macros |
Selected Objects. Sample macros:Remove Spaces from NamesDisplay Entities Note on
WorkspaceInfer Relationships on Selected EntitiesThe selected macro will be applied only on
the selected objects on the currently active Workspace.Select Macros | Productivity to access
macros from Productivity PackSelect Macros | Rename to access macros from Rename Objects
PackScenarioYou want to create a macro Add Attribute to PK and add this macro to pop-up
menu of attributes in Model Explorer.To create your own macroOpen Script Explorer (Tools
menu, Expert mode must be enabled).Right-click the Macros item and select Add New
Macro.Right-click the newly created macro and select Properties.Define properties of the new
macro. Remember to define its caption (macro name that will be displayed), visibility on tab
Visibility (if for all databases etc.).On tab Others, you can define Undo options. It is
recommended to keep the default settings.On tab Menu, you can define where you want to
display the macro - in Main menu, pop-up menu or both.Select Add to Popup Menuand write the
path name.On tab Object Types, select object types for which the macro will be available in
their pop-up menu. Select Attribute and confirm OK.Double-click the new macro to open the
Script Editor. Modify the default code at your convenience.Confirm Commit and Save.The
Macros will be available accordingly.   Related TopicsScript ExplorerScript Editor (page 1)

Toad Data Modeler User Guide

335

Projects and Models

Align Objects
To align objects in the Workspace
1. Select objects you want to align.
2. Click

on the toolbar (also select Objects | Align).

3. Select the way to align the objects from the Align Palette.
To align a self relationship
»

Right-click the entity and select Align Self Relationship.

To align handle points of relationship
1. Select the handle points (use ALT key to select a line segment, use SHIFT key to select
more line segments).
2. Select

on the toolbar (or select Objects | Align).

3. Click on the Handle Points icon, which enables only appropriate functions on the palette.

Arrange Objects, Match Size and Space Arrangement
Additional options for objects arrangement and objects resize can be found in menu Objects.

Toad Data Modeler User Guide

336

Projects and Models

Related Topics
Arrange Relationship Lines (page 337)

Arrange Objects in Layers
Toad Data Modeler allows you to rearrange/order objects on the Workspace in different layers.

To re-arrange the selected object on the Workspace
»

Right-click the object | Arrange and select any of the following options:
l

Bring to Front – Brings the object on the top layer.

l

Bring Forward – Brings the object one layer up.

l

Send Backward – Sends the object one layer down.

l

Send to Back – Sends the object to the lowest layer.

Z-Order Box
To put an object (e.g. entity) to exact layer
1. Right-click the entity and select Arrange | Settings.
2. In the Object Format dialog, see the Z-Order box. Use the small arrows to define the
layer number.

Toad Data Modeler User Guide

337

Projects and Models

Related Topics
Autolayout (page 333)
Format Objects (page 62)

Arrange Relationship Lines
In Toad Data Modeler, you can manage relationship lines in two modes:
l

Straight mode

l

Right Angled mode

Straight Mode
In the Straight mode, you can:
l

Add, move, remove and align handle points

l

Switch between straight and right-angled lines

To add handle points on the relationship line
1. Select the relationship.
2. Press CTRL, hold it down and click the relationship line where you want to add the
handle point.
To move a handle point
1. Select the relationship.
2. Point the mouse cursor at the handle point until a small black arrow displays.
3. Drag and drop it.
To remove a handle point
1. Select the relationship.
2. Press CTRL, hold it down and point your mouse cursor at a point you want to remove. ->
The mouse cursor changes to a small black arrow.
3. Click the selected point to remove it.
To align handle points
1. Select the handle points (use ALT key to select a line segment, use SHIFT key to select
more line segments).
2. Select Edit | Align. The Align Palette opens.

Toad Data Modeler User Guide

338

Projects and Models

3. Click on the Handle Points icon and select one of the enable options.

To change the mode of relationship lines on particular Workspace
»

Right-click the selected Workspace and click Straight All Lines or Change Lines to
Right Angled.

To change the mode of the selected relationship line on the Workspace
»

Right-click the selected relationship line(s) and click Straight Line or Change Line to
Right Angled.

Right Angled Mode
In the Right-angled mode:
l

You can add and remove handle points.

l

You cannot move handle points (but can move the selected line segment).

l

You cannot change the right-angled lines to straight lines (but can change the straight
lines to right-angled).

Move Relationship Anchor Points
Relationship automatically links the closest sides of entities. Anchor is always placed in the
middle of the entity box side and it's not possible to alter it.
You can only remove an anchor point from one entity to another or from one entity shortcut to
another. For this purpose, use the drag&drop techniques.
Move Relationship Lines
To move an entity with its relationship, including all handle points
»

Select the entity and the appropriate relationship (use SHIFT) and drag and drop
the entity.

Result: The selected entity, relationship and its handle points will move too. Position of handle
points will be preserved.
To move only the selected line segment
»

Press ALT key, hold it down, select the line segment and move it by the drag and drop
techniques or via the keyboard arrows.

Toad Data Modeler User Guide

339

Projects and Models

Note: This option works only for angled lines (however, in both Straight and
Right-angled modes).
Move, Hide, Find Relationship Names
To move the name of relationship on the Workspace
»

Right-click the selected relationship in particular place and select Move Caption Here.

To hide relationship names on the Workspace
»

Right-click the Workspace | Workspace Format | General tab | clear the Display Line
Names checkbox.

To find the relationship line by its name on the Workspace
»

Click the relationship name (caption). The appropriate relationship line will be
highlighted on the Workspace by the blue color.

To find the relationship name (caption) by its line on the Workspace
»

Click the relationship line, its name (caption) will be highlighted in a frame.

Related Topics
Format Workspaces and Objects (page 349)

Categories
Categories allow you to colorfully distinguish parts of your model. You can assign entities,
views and relationships to categories.
Example: In the main model, you want to distinguish all entities that relate to the Ordering
process. Or, you want to colorfully mark all entities that contain personal data of your
employees. Solution: You can simply create a category, select a color for it and assign
appropriate entities to the category. All the entities will be colored by the appropriate color.
An entity can be assigned only to one category.
Tips:
1. If you model has more categories, you can display a caption of the categories on the
Workspaces. See "Caption of Categories and Shortcuts" (page 83) for more information.
2. To display entities in Model Explorer by category, right-click the Model Explorer |
Settings | and select Use Colors of Category to Draw. Names of entities will be
displayed in color of appropriate category.
To add a category to your model
»

Select Model | Categories and click Add in the Category List  dialog.

Toad Data Modeler User Guide

340

Projects and Models

or
Model Explorer | Categories folder | Right-click and select Add Category.
Tip: You can also create a category directly in the Entity Properties form |
General tab. Just click the small button next to the Category box.
To edit a category
»

In the Category List dialog | double-click the selected category or click Edit.
or
Model Explorer | Categories  folder | double-click the selected category or rightclick | Edit.
Tip: You can also manage Categories via the Caption of Categories on
the Workspace.

Option

Description

Object
Navigator
Box

All categories of your model are listed here. The combobox allows you to edit them, one by one from one place.
Use Apply to confirm all the changes you make.

General
Tab

Description

Name

Category name

Color

Selected color for appropriate category

Description
Tab

Here, you can write any text description on the category.

Objects
Tab

A list of all entities, views and relationships of your
model. Those that have already been assigned to the
category are listed in the Selected section on the right.

To Do Tab

On this tab, you can write some tasks on the selected
category.
Note: To see all To Do tasks, select Model | To Do.

You can assign entities, views and relationships to category in the Category Properties dialog
and also in the object Properties dialog.

Toad Data Modeler User Guide
Projects and Models

To assign entity to category in the Category Properties dialog
1. Edit the selected category and click the Objects tab. All objects are listed in
alphabetical order.
2. Optional step: Start typing characters to activate filter at bottom of the form.
3. Select the entity and click the Add arrow button.

4.
To assign entity to category in the Entity Properties form
1. Double-click the selected entity (on the Workspace or Model Explorer).
2. Click the General tab in the Entity Properties form.
3. From the Category box, select the category.
Tips:
1. To copy categories, use CTRL + Drag&Drop techniques.
2. To delete categories:
l

In the Category List dialog, select a category and click Delete.

l

Model Explorer | Categories folder | Right-click and select Delete Item.

Related Topics
Caption of Categories and Shortcuts (page 83)
To select more objects on WS by category or schema/owner (page 67)

341

Toad Data Modeler User Guide
Projects and Models

Change Notation
To change or select notation for your model
»
IDF1X

IE

Select View | Notation | IE or IDEF1X.

342

Toad Data Modeler User Guide
Projects and Models

Data Warehouse Types
In physical model you can define Data Warehouse Type for your tables and graphically
distinguish the Fact and Dimension tables.
Example:

343

Toad Data Modeler User Guide

344

Projects and Models

By default, the Data Warehouse options are not available and must be activated in Settings.
Standard Entity Properties form:

To display Data Warehouse Type options
»

Click Settings | Options and in section Physical Model enable checkbox in group box
Form Settings.

Toad Data Modeler User Guide
Projects and Models

To set Data Warehouse Type
»

Choose Dimension or Fact value from the Data Warehouse Type.

345

Toad Data Modeler User Guide

346

Projects and Models

Display Modes
In Toad Data Modeler, you can switch between a logical and physical views and full name view.

»

Click

Logical View (Captions)

on the toolbar (also View | Display Mode.)

Toad Data Modeler User Guide
Projects and Models

Physical View (Names)

Full Names

347

Toad Data Modeler User Guide

348

Projects and Models

Display Level for Entities
Toad Data Modeler allows you to display entities on Workspaces in several levels:
PER Model
l

Entities

l

Primary Keys

l

PK and FK keys

l

All Keys

l

Attributes

LER Model
l

Entities

l

Primary Identifiers

l

Unique Identifiers

l

Attributes

l

Descriptions - Text written on the Description tab of entity will be displayed on the WS.

Toad Data Modeler User Guide

349

Projects and Models

To set up default display level for the selected Workspace
»

Change the display level from the Display Level box on the toolbar (also View |
Display Level).
Note: Also right-click the work area | Workspace Format | Entities tab |
Display Level.

To set up default display level for new model (models that you will create)
»

Select Settings | Options | Physical/Logical Model | Entity tab.

Format Workspaces and Objects
You can set up format for all Workspaces of your model, for each Workspace separately and also
for particular objects.
To set up format for new models (models that you will create)
1. Select Settings | Options | Model section | Physical/Logical Model.
2. Define options on tabs Workspace, Shape and Entity.
3. Press CTRL+N to create a new model.
To change format of objects in existing models
»

Right-click the Workspace and select Workspace Format.

To change format of a particular object
»

Right-click the object on Workspace and select Format.
Tip: If you need to preserve format of a particular object against changes of format
of your WS, select the Lock Format option in the Object Format dialog |
General tab.

To set the same size for the selected objects on the Workspace
1. Make the selection of objects (SHIFT).
2. Right-click the particular object of which size you want to apply and select Set Same
Size for the Selected Objects.

Toad Data Modeler User Guide

350

Projects and Models

Select Colors for Attributes and Keys
To define different colors for attributes on your Workspace
»

Select Settings | Options | Model section | Physical Model/Logical Model| Entity tab |
Attribute Colors area.

Tip: When you point your mouse cursor at a relationship line, parent and child attributes are
highlighted on the Workspace. You can set up the color at: Settings | Options | Graphics |
Colors area | Highlight Color.

Toad Data Modeler User Guide

351

Projects and Models

Show Grid and Grid Size
The Grid options are available directly from the toolbar or from the View menu.
To show grid and set a grid size
1. Click

to show grid.

2. To change a grid size, click

.

3. To snap objects of your ERD to grid, click

.

Zoom, Overview, Loupe, Move
Toad Data Modeler offers you various view options for more comfortable work in your model zoom in, zoom out, zoom box, overview, loupe and move.
All these options can be found on appropriate icons on the toolbar or in the View menu.
Tip: Feel free to dock the windows Overview and Loupe.
Tips
Objects on the Workspace and Keyboard Arrows
l

Move entities on the Workspace via keyboard arrows.
Tip: To set up the size of a step to move, select Settings | Options | Graphics |
Move Objects by (mm/10) (in tenths of milimeters).

l

Select an entity on the Workspace, press SHIFT, hold it down and use the keyboard
arrows to change size of the entity box.

Navigation on the Workspace
l

CTRL + scroll mouse to zoom in/zoom out

l

CTRL +, CTRL + Page Up to zoom in

l

CTRL-, CTRL+ Page Down to zoom out

l

Scroll mouse to move up/down on the Workspace

l

SHIFT + scroll mouse to move to the right/left on the Workspace

l

Holding down the middle button to move on entire page/Workspace

l

Page Down, CTRL + down to move to next page

Toad Data Modeler User Guide

352

Projects and Models

l

Page Up, CTRL + up to move to previous page

l

CTRL + left to move to the left page

l

CTRL + right to move to the right page

Tools
Refactoring Utility
Now you can rename objects in your model and use Refactoring Utility to change names in
other objects properties, like SQL code in Triggers, Stored Procedures etc.

l

In section Previously Renamed Object (top-right), you can find objects that were
renamed.

l

In section Objects to Modify, you can find objects and properties that contain old names.

l

In section Current Code, the body of SQL code is shown.

l

Use buttons Previous Term and Next Term to navigate among names in the same code.

l

Section Preview of Modified Code shows suggested names. You can click any of the
suggested term and choose old or new name or use the icons in middle column to reject
suggested change.

Note that renaming from the default name is ignored deliberately!
Fats Parser checkbox- if enabled, it indicates availability of advanced parsing option and
enables switching between Fast and Advanced parsers.

Toad Data Modeler User Guide

353

Projects and Models

Schema/Owner/Database Assignment
This option allows you to assign schema/owner/database/user to your model at one jump or
remove existing schema from objects of your model at one jump.
Note: Schema, user, owner, database - database dependent issues. E.g. Oracle db - users.
To assign a schema/owner to your model
»

Select Tools | Schema/Owner Assignment....

Option

Description

Select
Schema/Owner/Database

Selection of schemas that exist in your
model.
Example: Oracle 10g model, user SCOTT
exists in the Videorental model.
Select --None-- from the list to remove the
existing schema from objects you define in

Toad Data Modeler User Guide

354

Projects and Models

Option

Description
the Select types of objects area.

Assign to objects where
value is not defined

Assigns schema to objects without
schema/removes schema from objects with
schema.

Confirm before
assignment checkbox

Confirmation dialog for each object where
schema is being assigned/removed will be
displayed.

Select types of objects
area

Select objects to which you want to
assign/remove schema.

Execute

Starts the process.

Close

Closes the dialog.

Related Topics
To select more objects on WS by category or schema/owner (page 67)

Naming Conventions
About Naming Conventions
Toad Data Modeler allows you to use naming conventions in your physical models. What are
naming conventions? Via naming conventions you can:
l

Define your own rules for physical names of objects – e.g. add prefix or suffix to the
names, use only lower case etc.

l

Synchronize caption (logical name) and name (physical name) of objects of your model.

l

Verify whether the physical names of objects match the naming convention rules. If they
don’t, you can decide whether to apply them or not.

Note: Naming conventions always influence physical names, NOT captions. Captions (logical
names) can be in various forms as they provide logical information only.

Naming Conventions in Toad Data Modeler – Basic Information
l

Naming conventions are supported for most objects of physical model for which you can
define a name (physical name) and a caption (logical name).

Toad Data Modeler User Guide

355

Projects and Models

l

A naming convention can be used in various models across different database systems.
You can use them for new models, reversed models or models that already exist in Toad
Data Modeler.

l

Every defined naming convention is stored in external .TXN file stored by default in your
Documents folder, directory Toad Data Modeler\ Installation name\Naming Conventions.

l

You can define only one naming convention for one model.

l

Toad Data Modeler allows you to:
o

Automatically create physical names based on logical names and naming
conventions rules. (Example: Customer ID => T_CUSTOMER_ID). This feature
makes you more productive as you need significantly less time to define both
logical and physical names.

o

Define valid characters for physical names and set how invalid characters should
be replaced.

o

Use glossaries for automatic word replacement during new objects creation.
Glossaries can be made of multiple CSV files and you can easily turn on or turn
off the selected glossaries.

o

Verify naming conventions and rewrite physical names in a batch mode. Check
your model and replace physical names of objects that don’t match naming
conventions rules.

o

Synchronize captions and names (without specific naming convention definitions).

o

Import/export of glossaries (*.CSV files) also from/to other tools.
See the Naming Convention Properties dialog | Glossary tab | Import button.
You can find some CSV files with diacritical marks at: C:\Program Files\Quest
Software\Toad Data Modeler 3\Naming Conventions\CSV.

Related Topics
Basic Operations (page 355)

Basic Operations
To define a new naming convention for your model
1. Click

on the toolbar (or select Settings | Naming Convention).

2. Click Add New Naming Convention.
3. In the Adding Naming Convention dialog, define the name and confirm OK.
4. Select the naming convention for the model and confirm OK+Edit.
5. Define the naming convention rules in the Naming Convention Properties dialog.

Toad Data Modeler User Guide

356

Projects and Models

To link existing naming convention to your model
1. Click

on the toolbar (or select Tools | Naming Conventions |Settings).

2. Select the naming convention.
Note: You can also select a naming convention to your model in the Model
Properties dialog | Naming Convention tab.
3. Click OK+Edit.
To verify whether the physical names in your model match the naming convention rules
(and also to decide whether you want to apply them for particular item or not)
1. Click
on the toolbar (or select Tools | Naming Conventions |Verify Naming
Conventions).
2. In the Naming Convention Verification & Synchronization dialog, you can see a list of
items that do not match either the naming convention rules (NC column) or the
synchronization rules (Sync column).
Compare the items in the Physical Name column (current physical name) and Expected
Physical Name column (physical name after the naming convention rules are applied).
Note: If more variants of the physical name exists, there is a combo box in the
Expected Physical Name column. From this combo box, you can choose the
preferred name.
Tip: Point the mouse cursor at the icons or click the selected row to learn
more details.
3. Select the items for which you want to apply the rules.
4. Click Update and Close then.
To edit a naming convention linked to your model
»

Click

on the toolbar.

To manage naming conventions (add, edit, delete, rename)
»

Select Tools | Naming Conventions.

To unlink the naming convention from your model
1. Select Model | Model Properties | Naming Convention tab.
2. From the Name box, select ---.
3. Confirm OK.
To manage the particular naming convention from the Object Properties dialog (e.g. Entity
Properties form)
»

Right-click the Name box.

Toad Data Modeler User Guide

357

Projects and Models

Option

Description

Reset Name to

Offers a physical name or names that match the defined
naming convention rules.

Explain Violation

Opens a dialog with the information explaining why the
physical name does not match the defined naming
convention rules.

Edit Naming
Convention

Opens the Naming Convention Properties dialog.

Verify Naming
Convention Rules

Turns on or off the naming convention rules (take notice of
the icon on the right next to the Name box).

Tip: Read the User Guide, "Naming Conventions" chapter, "Scenarios" topics to get practical
examples on how to use the naming conventions.

Related Topics
Naming Convention Properties (page 358)
Naming Convention Settings In the Naming Convention Properties dialog | General tab, you can
see options for: Synchronization of Captions and Names Verification of Names Read the
following use cases for different settings of these options. Tip: See the User Guide, "Naming
Conventions" chapter for more practical examples.  Synchronization of Captions and NamesA:
Automatic Synchronization On, Apply Naming Convention Rules OnIf you enable both
checkboxes, captions and names will be automatically synchronized, naming conventions rules
will be applied automatically and glossaries will be used too.Example: The new logical name
defined as Exemplar will be converted to physical name to T_EXEMPLAR automatically.
Customer will be converted to T_CUS etc.Use: These settings are great for modeling new ER
Diagrams according to naming convention rules. Automatic synchronization will create physical
names based on logical names, naming convention plus glossary definitions automatically. Using
these settings, you can save time during modeling new database structures. B: Automatic
Synchronization Off, Apply Naming Convention Rules OffIf you create a new naming

Toad Data Modeler User Guide

358

Projects and Models

convention and clear both checkboxes, you will turn off automatic synchronization.Use: This is
handy if you reverse engineer a physically existing database and start to modify captions (logical
names). Names (physical names) will stay preserved. C: Automatic Synchronization On, Apply
Naming Convention Rules OffUse these settings if you want to synchronize captions with
physical names, but don’t want to apply naming convention rules during
synchronization.Example:T_EXEMPLAR (logical name) => T_EXEMPLAR (physical name).
Prefix will not be automatically added to the physical name because your already defined it in
caption (logical name).Use: This can be useful when you need to rewrite the caption (logical
name) and want the physical name to change automatically. Or if you are used to defining
logical names in accordance with naming convention rules. D: Automatic Synchronization Off,
Apply Naming Convention Rules OnYou turn off the automatic synchronization as you want to
synchronize some selected items manually.Use: Use these settings if you are used to defining
both captions and names manually – with the advantage to apply the naming convention rules
during manual synchronization.How does it work? - E.g. in the Entity Properties form, you
define the caption and physical name manually. Later you find out that something is wrong with
the physical name (it violates the naming convention rules). -> Clicking the arrow button
between the Caption and Name boxes (manual synchronization) will change the physical name
and the naming convention rules will be applied Verification of NamesCheckboxes in the
Verification of Names area affect behavior of the Naming Convention Verification and
Synchronization feature.    (page 1)
Naming Convention Properties
To define properties of the naming convention linked to your model
1. Click

on the toolbar.

2. On tab General, define the synchronization and verification settings.
See "Naming Convention Settings In the Naming Convention Properties dialog |
General tab, you can see options for: Synchronization of Captions and Names
Verification of Names Read the following use cases for different settings of these
options. Tip: See the User Guide, "Naming Conventions" chapter for more
practical examples.  Synchronization of Captions and NamesA: Automatic
Synchronization On, Apply Naming Convention Rules OnIf you enable both
checkboxes, captions and names will be automatically synchronized, naming
conventions rules will be applied automatically and glossaries will be used
too.Example: The new logical name defined as Exemplar will be converted to
physical name to T_EXEMPLAR automatically. Customer will be converted to T_
CUS etc.Use: These settings are great for modeling new ER Diagrams according to
naming convention rules. Automatic synchronization will create physical names
based on logical names, naming convention plus glossary definitions
automatically. Using these settings, you can save time during modeling new
database structures. B: Automatic Synchronization Off, Apply Naming Convention
Rules OffIf you create a new naming convention and clear both checkboxes, you
will turn off automatic synchronization.Use: This is handy if you reverse engineer
a physically existing database and start to modify captions (logical names). Names
(physical names) will stay preserved. C: Automatic Synchronization On, Apply

Toad Data Modeler User Guide

359

Projects and Models

Naming Convention Rules OffUse these settings if you want to synchronize
captions with physical names, but don’t want to apply naming convention rules
during synchronization.Example:T_EXEMPLAR (logical name) => T_
EXEMPLAR (physical name). Prefix will not be automatically added to the
physical name because your already defined it in caption (logical name).Use: This
can be useful when you need to rewrite the caption (logical name) and want the
physical name to change automatically. Or if you are used to defining logical
names in accordance with naming convention rules. D: Automatic
Synchronization Off, Apply Naming Convention Rules OnYou turn off the
automatic synchronization as you want to synchronize some selected items
manually.Use: Use these settings if you are used to defining both captions and
names manually – with the advantage to apply the naming convention rules
during manual synchronization.How does it work? - E.g. in the Entity Properties
form, you define the caption and physical name manually. Later you find out that
something is wrong with the physical name (it violates the naming convention
rules). -> Clicking the arrow button between the Caption and Name boxes (manual
synchronization) will change the physical name and the naming convention rules
will be applied Verification of NamesCheckboxes in the Verification of Names
area affect behavior of the Naming Convention Verification and Synchronization
feature.   " (page 1) for more information.

2. On tab Naming Convention Rules, define the rules. See "Naming Convention Valid
Characters" (page 362) for more information on defining valid characters.
Note: Click the particular column and use F2 to turn on the edit mode. Press Enter

Toad Data Modeler User Guide

360

Projects and Models

to confirm every rule you define in the form.

3. On tab Glossary, you can define what characters and words should be replaced in the
physical name of objects. On this tab, you can also import and export .CSV files.
In the example below, some CSV files have been imported from C:\Program
Files\Quest Software\Toad Data Modeler 3\Naming Conventions\CSV.

Toad Data Modeler User Guide

361

Projects and Models

Option

Description

Glossaries

Name of a glossary for character/word replacement

Add

Adds a new glossary
The glossary must be in the following format: original
char/word=new char/word.

Delete

Deletes the selected glossary

Import

Opens the Import dialog for import of CSV files

Export

Opens the Export dialog for export of the selected CSV
file

4. Confirm the naming convention settings OK.

Related Topics
Naming Convention Valid Characters (page 362)
Verification of NamesTo verify whether the physical names in your model match the naming
convention rules (and also to decide whether you want to apply them for particular item or not)
Click on the toolbar (or select Tools | Naming Conventions | Verification...).In the Naming

Toad Data Modeler User Guide

362

Projects and Models

Convention Verification & Synchronization dialog, you can see a list of items that do not match
either the naming convention rules (NC column) or the synchronization rules (Sync
column).Compare the items in the Physical Name column (current physical name) and Expected
Physical Name column (physical name after the naming convention rules are applied).Tip: Point
the mouse cursor at the icons or click the selected row to learn more
details.OptionDescriptionShow Naming Convention ViolationsShow Synchronization
ViolationsSelect AllDeselect AllGo to previous violationGo to next violationTurn on
FilterLogical NameCurrent logical name of objectPhysical NameCurrent physical name of
objectNC Apply the naming convention rules. (Click this icon to get the following icon.) Do not
apply the naming convention rules. (The red color means that the physical name will not match
the naming convention rules defined in the Naming Convention Properties dialog.) Sync Apply
the synchronization rules. (Click this icon to get the following icon.) Do not apply the
synchronization rules. (The red color means that the physical name will not match the
synchronization rules defined in the Naming Convention Properties dialog | General tab.)
Expected Physical NamePhysical name after the naming convention and synchronization rules
will be applied.If more variants of the physical name exists, there is a combo box from which
you can choose the preferred name.Tip: You can also see the name/names in the Properties
dialog of particular object (e.g. Entity Properties form), right-click the Name box and select Reset
Name to.Select the items for which you want to apply the rules.Click Update and Close
then. Tip: Read the User Guide, "Naming Conventions" chapter, "Scenarios" topics to get
practical examples on how to use the naming conventions. Related TopicsBasic
OperationsNaming Convention PropertiesNaming Convention Settings (page 1)
Naming Convention Valid Characters
On tab Naming Convention Rules you can define valid characters for physical names and also
set how invalid characters should be replaced.
Example: Let’s say you have set a space as invalid character for entity names in your naming
convention. See how Toad Data Modeler will behave in the following situation:
Customer Data logical name in the Caption box, will automatically change to CustomerData
physical name in the Name box. -> The space will be ignored.
You edit the naming convention and define that every space should be replaced with '_'.
Customer Data logical name in the Caption box, will change to Customer_Data physical name
in the Name box.
Once you manually edit the physical name, the automatic synchronization will turn off.
Valid Characters and Character/Word Replacement
Character Replacement
Use Character Replacement to replace diacritical characters. Do not use Character Replacement
to replace a space with another character.

Toad Data Modeler User Guide

363

Projects and Models

Word Replacement
Use Word Replacement to replace one word with another word or more words. Word
Replacement launches after characters are replaced.
Valid Characters + Replacement
Use this combination to define valid characters. Also, it is possible to replace invalid characters
with an alternative character. Check of valid characters launches as last. See the example below.
Example:
Character Replacement:
ñ -> n
Word Replacement:
espanoles -> esp
residentes -> res
Valid Characters:
Space -> _
Toad Data Modeler proceeds in the following order:
1) "residentes españoles" -> "residentes espanoles"
2) "residentes espanoles" -> "res esp"
3) "res esp" -> "res_esp"

Toad Data Modeler User Guide
Projects and Models

Valid Characters Definition

Option

Description

All Characters
Except Space Character

If it is selected, all characters are valid except
for a space.

Except

Click this checkbox and manually write out
character set that you want to forbid.
See "Character Set Syntax" (page 365) for
more information.

User Defined
Character Set

Select this option to manually define
character set. Incorrect definition will be
highlighted in red.
See "Character Set Syntax" (page 365) for
more information.
Note: Valid character set is automatically

364

Toad Data Modeler User Guide
Projects and Models

Option

Description
written out in the Valid Chars column.

Selected Characters

Select any of the following options to set:

All Standard ASCII
Characters (0-127)

- all standard ASCII characters valid, others
are forbidden.

Space (32)

- only Space (32) character as valid.
Note: Number 32 is an ordinal value of the
Space character.

Number '0'-'9'

- number 0 – 9 as valid.

Lower Characters

- only lower characters as valid.

Underscore (95)

- Underscore 95 as valid.
Note: Number 95 is an ordinal value of the
Underscore character.

Upper Characters

- only upper characters as valid.

Language Specific
Chars

- a diacritical character set of the particular
language as valid. Click the box on the right
to select the language.
Tip: You can create your own table with
diacritical character set for your language.
See: C:\Program Files\Quest Software\Toad
Data Modeler 3\Naming Conventions\CSV.
Create your CSV file in this location.

Valid Chars Column

In this column, a complete character set is
written out – according to your settings in
the Valid Characters area.
Note: You can also define the character set
manually to this column – via F2 key.
However, to make sure your character set is
correct, please use the User Defined
Character Set option.

Replacer Column

Define a character that will be used as a
replacer.
Example: underscore character.

Character Set Syntax
Example: Character set for letters a,b,c and numbers 0,1,2:

365

Toad Data Modeler User Guide

366

Projects and Models

l

Single character in single quote, divided by comma: 'a', 'b', 'c', '0', '1', '2'

l

Single character’s ordinal value divided by comma: 97,98,99,48,49,50

l

Single character’s ordinal value divided by comma, in hexadecimal format: $61, $62, $63,
$30, $31, $32

l

Set of characters in single quote: 'a'-'c', '0'-'2'

l

Set of characters as ordinal value: 97-99, 48-50

l

Set of characters as ordinal value in hexadecimal format: $61-$63, $30-$32

l

Any combination: 'a'-$63, $30-49, '2'

Related Topics
Naming Convention Properties (page 358)
Naming Convention Settings
In the Naming Convention Properties dialog | General tab, you can see options for:
l

Synchronization of Captions and Names

l

Verification of Names

Read the following use cases for different settings of these options.
Tip: See the User Guide, "Naming Conventions" chapter for more practical examples.

Synchronization of Captions and Names
A: Automatic Synchronization On, Apply Naming Convention Rules On

If you enable both checkboxes, captions and names will be automatically synchronized, naming
conventions rules will be applied automatically and glossaries will be used too.
Example: The new logical name defined as Exemplar will be converted to physical name to T_
EXEMPLAR automatically. Customer will be converted to T_CUS etc.
Use: These settings are great for modeling new ER Diagrams according to naming convention
rules. Automatic synchronization will create physical names based on logical names, naming

Toad Data Modeler User Guide

367

Projects and Models

convention plus glossary definitions automatically. Using these settings, you can save time
during modeling new database structures.

B: Automatic Synchronization Off, Apply Naming Convention Rules Off

If you create a new naming convention and clear both checkboxes, you will turn off automatic
synchronization.
Use: This is handy if you reverse engineer a physically existing database and start to modify
captions (logical names). Names (physical names) will stay preserved.

C: Automatic Synchronization On, Apply Naming Convention Rules Off

Use these settings if you want to synchronize captions with physical names, but don’t want to
apply naming convention rules during synchronization.
Example:T_EXEMPLAR (logical name) => T_EXEMPLAR (physical name).
Prefix will not be automatically added to the physical name because your already defined it in
caption (logical name).
Use: This can be useful when you need to rewrite the caption (logical name) and want the
physical name to change automatically. Or if you are used to defining logical names in
accordance with naming convention rules.

Toad Data Modeler User Guide

368

Projects and Models

D: Automatic Synchronization Off, Apply Naming Convention Rules On

You turn off the automatic synchronization as you want to synchronize some selected
items manually.
Use: Use these settings if you are used to defining both captions and names manually – with the
advantage to apply the naming convention rules during manual synchronization.
How does it work? - E.g. in the Entity Properties form, you define the caption and physical
name manually. Later you find out that something is wrong with the physical name (it violates
the naming convention rules). -> Clicking the arrow button between the Caption and Name
boxes (manual synchronization) will change the physical name and the naming convention rules
will be applied

Verification of Names
Checkboxes in the Verification of Names area affect behavior of the Naming Convention
Verification and Synchronization feature.

Verification of Names
To verify whether the physical names in your model match the naming convention rules
(and also to decide whether you want to apply them for particular item or not)
1. Click

on the toolbar (or select Tools | Naming Conventions | Verification...).

2. In the Naming Convention Verification & Synchronization dialog, you can see a list of
items that do not match either the naming convention rules (NC column) or the

Toad Data Modeler User Guide

369

Projects and Models

synchronization rules (Sync column).
Compare the items in the Physical Name column (current physical name) and Expected
Physical Name column (physical name after the naming convention rules are applied).
Tip: Point the mouse cursor at the icons or click the selected row to learn
more details.

Option

Description
Show Naming Convention Violations
Show Synchronization Violations
Select All
Deselect All
Go to previous violation
Go to next violation
Turn on Filter

Logical
Name

Current logical name of object

Physical
Name

Current physical name of object

NC

Apply the naming convention rules. (Click this icon

Toad Data Modeler User Guide

370

Projects and Models

Option

Description
to get the following icon.)
Do not apply the naming convention rules. (The red
color means that the physical name will not match the
naming convention rules defined in the Naming
Convention Properties dialog.)

Sync

Apply the synchronization rules. (Click this icon to
get the following icon.)
Do not apply the synchronization rules. (The red
color means that the physical name will not match the
synchronization rules defined in the Naming
Convention Properties dialog | General tab.)

Expected
Physical
Name

Physical name after the naming convention and
synchronization rules will be applied.
If more variants of the physical name exists, there is a
combo box from which you can choose the preferred
name.
Tip: You can also see the name/names in the Properties
dialog of particular object (e.g. Entity Properties form),
right-click the Name box and select Reset Name to.

3. Select the items for which you want to apply the rules.
4. Click Update and Close then.
Tip: Read the User Guide, "Naming Conventions" chapter, "Scenarios" topics to get practical
examples on how to use the naming conventions.

Related Topics
Basic Operations (page 355)
Naming Convention Properties (page 358)
Naming Convention Settings In the Naming Convention Properties dialog | General tab, you can
see options for: Synchronization of Captions and Names Verification of Names Read the
following use cases for different settings of these options. Tip: See the User Guide, "Naming
Conventions" chapter for more practical examples.  Synchronization of Captions and NamesA:
Automatic Synchronization On, Apply Naming Convention Rules OnIf you enable both
checkboxes, captions and names will be automatically synchronized, naming conventions rules
will be applied automatically and glossaries will be used too.Example: The new logical name

Toad Data Modeler User Guide

371

Projects and Models

defined as Exemplar will be converted to physical name to T_EXEMPLAR automatically.
Customer will be converted to T_CUS etc.Use: These settings are great for modeling new ER
Diagrams according to naming convention rules. Automatic synchronization will create physical
names based on logical names, naming convention plus glossary definitions automatically. Using
these settings, you can save time during modeling new database structures. B: Automatic
Synchronization Off, Apply Naming Convention Rules OffIf you create a new naming
convention and clear both checkboxes, you will turn off automatic synchronization.Use: This is
handy if you reverse engineer a physically existing database and start to modify captions (logical
names). Names (physical names) will stay preserved. C: Automatic Synchronization On, Apply
Naming Convention Rules OffUse these settings if you want to synchronize captions with
physical names, but don’t want to apply naming convention rules during
synchronization.Example:T_EXEMPLAR (logical name) => T_EXEMPLAR (physical name).
Prefix will not be automatically added to the physical name because your already defined it in
caption (logical name).Use: This can be useful when you need to rewrite the caption (logical
name) and want the physical name to change automatically. Or if you are used to defining
logical names in accordance with naming convention rules. D: Automatic Synchronization Off,
Apply Naming Convention Rules OnYou turn off the automatic synchronization as you want to
synchronize some selected items manually.Use: Use these settings if you are used to defining
both captions and names manually – with the advantage to apply the naming convention rules
during manual synchronization.How does it work? - E.g. in the Entity Properties form, you
define the caption and physical name manually. Later you find out that something is wrong with
the physical name (it violates the naming convention rules). -> Clicking the arrow button
between the Caption and Name boxes (manual synchronization) will change the physical name
and the naming convention rules will be applied Verification of NamesCheckboxes in the
Verification of Names area affect behavior of the Naming Convention Verification and
Synchronization feature.    (page 1)

Infer Relationships
This feature tries to map Primary Key or Alternate Key attributes with identically named
attributes in other entities.
Conditions:
l

Mapping is performed between key and non-key attributes. In other words, if identically
named attributes are part of primary key in various tables, e.g. ID column in table
Customer and ID column in table Order, the two ID columns will not be mapped and no
relationship will be created.

l

Names must be identical and data type must be the same, including parameters.

l

Non-identifying relationships are created by default. In case you need identifying
relationship, edit the automatically added relationship and change its type from nonidentifying to identifying manually.

To run the Infer Relationship function
»

Click Tools | Infer Relationship

Toad Data Modeler User Guide

372

Projects and Models

Example:
Model with no relationships. See the Customer ID column in tables Customer and Order
Record.
In table Film there is alternate key with two columns Title and Director. Identically named
columns are in table Customer Rating.

Run the Infer Relationship function and see result:

Toad Data Modeler User Guide

373

Projects and Models

Infer Relationships and Reverse Engineering
The same functionality can be executed automatically during the process of reverse engineering.
Create a new connection or edit existing stored connection and check the Infer Relationships
check box to activate this feature.

Toad Data Modeler User Guide

374

Projects and Models

Features
Application Variables
Application Variables
In Toad Data Modeler you can use application variables in:
l

Default values (e.g. relationship names)

l

Templates

l

Properties that contain SQL code (any property that contains the attribute Resolve
Application Variables, for example: SQL, Before Script, After Script) - Please see the
Reference Guide for more details on the Resolve Application Variables attribute.
Note: The Resolve Application Variables attribute determines where (for which
properties of object) an application variable can be used. E.g. Entity.After Script
has the Resolve Application Variables attribute, however Entity.Name doesn't have
it. Therefore in Entity.Name, an application variable cannot be used.

Application variables are usually resolved during SQL script generation.
Syntax of Application Variables
1. <%ApplicationVariableName%> - Example: <%Date%>
2. <%<% ApplicationVariableName %>%> - Example: <%<%Date%>%>
Syntax 2) is sometimes used in templates and default values. It means that the
application variable will be resolved only during SQL script generation, not at the
time of using the template or default value.
List of Application Variables
All properties of data type widestring of actual object (see the Reference Guide) and the
following application variables:
All
Date

CheckConstraintDomain
AsText

EntityTrigger
TableName

Year

TableName

TableFullName

UniqueNumber

ColumnName
TableFullName

Author
Time
DateTime
OwnerName

Toad Data Modeler User Guide

375

Projects and Models

OwnerCaption
PERBase
OwnerFullNam
e

CheckConstraintAttribute
AsText
TableName

ViewTrigger
ViewName
ViewFullName

ColumnName
TableFullName
Relation
ParentTableNa
me
ChildTableNa
me

CheckConstraintEntity
AsText
TableName
TableFullName

Attribute
ParentAttributeNam
e
ParentAttributeCapt
ion
TableName
TableFullName

Note: OwnerName, OwnerCaption - Explanation: E.g. For attribute it is an entity, for entity it is
a model. It has nothing to do with object Owner/Schema.

Related Topics
Application Variables - Examples (page 376)
Templates (page 473)

Toad Data Modeler User Guide
Projects and Models

Application Variables - Examples
Application Variables and User Template

Application Variables and Default Values
Example: Define a new name and caption for relationships of your model.
Caption: <%ParentTableName%> - <%ChildTableName%>
Name: <%ParentTableName%>_<%ChildTableName%>

376

Toad Data Modeler User Guide

377

Projects and Models

Application Variables and Self-Relationships
Possibility to define a name for propagated attributes in self-relationships (e.g. via prefix,
suffix etc.)
Select Settings | Options | Physical Model | Self Relation Attribute Name/Caption.
Example: Name: FK_<%ParentAttributeName%>, Caption: Foreign
<%ParentAttributeCaption%>

Application Variables and Text Properties
You can use some text properties of particular objects in a similar way as application variables.
Example: You want to see your comments in a pop-up window on the Workspace whenever
you point your mouse cursor at the entity name. But comments are not displayed this way, only
notes. OR You want to generate notes in SQL script.
Possible solution: In the Entity Properties form,
1. On tab Notes, write the text, e.g. My Description.
2. On tab Comments, write: <%Notes%>.
3. Confirm Apply.
4. See the SQL Preview tab.

5. Click
to display a quick help bar with application variables that are possible to
use in entity.

Toad Data Modeler User Guide
Projects and Models

Example: Name is property of entity. It is of widestring data type, so you can use
application variable <%Name%>. Author is not property of entity. However, you
can use the application variable <%Author%> in entity. - All the application
variables that you can use for entity are available in the list.
Tips:
l

Double-click the selected application variable to use it in the box/place
where you have your cursor.

l

Press Esc to close the dialog.

Note: The list of properties that you can use this way is available in the
Reference Guide.

378

Toad Data Modeler User Guide

379

Projects and Models

Application Variables in Wizards
Sync & Convert Wizard| page Settings and Report Wizard | page Options and the Resolve
Application Variables checkbox.
Clear the checkbox to compare models/generate report without resolving the application
variables.
Select the checkbox to compare models/generate report while resolving the application variables.

Related Topics
Features (page 374)
Templates (page 473)
Default Values (page 470)

Command Line Parameters
Available command line parameters:
l

Open-File

l

New-Model

l

Execute-Script

l

Start-Log

l

Import Toad for Oracle ER diagram and Toad for Oracle Project

Open-File
Opens file defined in command line parameters.
Definition:
Open-File<space>-File<Delimiter>Name=<string>[,Name=<string>]*
Example:
TDM.exe Open-File -File:Name="My logical model.txl", Name="My physical model.txp"
New-Model
Creates a new model
Definition:
New-Model<space>-ModelType<Delimiter><string>[<space>-ModelName<delimiter><string>]
Examples:

Toad Data Modeler User Guide

380

Projects and Models

TDM.exe New-Model -ModelType "Logical Model"
TDM.exe New-Model -ModelType "Logical Model" -ModelName:"My Database Model"
Execute-Script
Executes script stored in TDM. First parameter must contain ScriptName, second must contain
ScriptMethodName, other parameters are parameters of the ScriptMethod.
Definition:
Execute-Script<space>[Parameter<Delimiter><HashValues>+]<Switches>
<Switches> := -<InputScript><space>[-<OtherSwitch>]
<InputSwitch> := -TDM
<OtehrSwitch> := -Silent
<HashValues> := <ScriptName>=<string>,<MethodName>=<string>[,<Name>=<string>]*
Examples:
TDM.exe Execute-Script -Parameter
ScriptName=MyScript,MethodName=MyMethodInsideMyScript,Par1Name=Par1Value,Par2Name
=Par2Value -TDM
TDM.exe Execute-Script -Parameter ScriptName=MujScript,MethodName=MojeMetoda -TDM
-Silent
Switches:
-TDM. Explanation: Script is stored in TDM application. (Other switches will be defined later
and users will be able to execute scripts outside TDM.)
-Silent. Explanation: Script will be executed in Silent mode and you will be able to work with
the application regardless the state of the executed script.
Start-Log
Writes messages to log. May be useful for sending reports to TDM developers.
Definition:
Start-Log
Import Toad for Oracle ER Diagram and Toad for Oracle Project
TDM.exe Import-ToadForOracleERD -file:"NopathMovERD.erd"
TDM.exe Import-ToadForOracleERD -file:NopatMovERD.erd Connection:"SERVER=OstDbServer:1521/ORCL,

Toad Data Modeler User Guide

381

Projects and Models

USER=movies,PROTOCOL=TNS,CONNECTAS=NORMAL,SAVEPASSWORD=1,ORACLEH
OME=c:\oracle\product\10.2.0\db_1,HOST=OstDbServer,SErVICENAME=ORCL,
PORT=1521,LDAP=,METHOD=1"

Categories
Categories allow you to colorfully distinguish parts of your model. You can assign entities,
views and relationships to categories.
Example: In the main model, you want to distinguish all entities that relate to the Ordering
process. Or, you want to colorfully mark all entities that contain personal data of your
employees. Solution: You can simply create a category, select a color for it and assign
appropriate entities to the category. All the entities will be colored by the appropriate color.
An entity can be assigned only to one category.
Tips:
1. If you model has more categories, you can display a caption of the categories on the
Workspaces. See "Caption of Categories and Shortcuts" (page 83) for more information.
2. To display entities in Model Explorer by category, right-click the Model Explorer |
Settings | and select Use Colors of Category to Draw. Names of entities will be
displayed in color of appropriate category.
To add a category to your model
»

Select Model | Categories and click Add in the Category List  dialog.
or
Model Explorer | Categories folder | Right-click and select Add Category.
Tip: You can also create a category directly in the Entity Properties form |
General tab. Just click the small button next to the Category box.

To edit a category
»

In the Category List dialog | double-click the selected category or click Edit.
or
Model Explorer | Categories  folder | double-click the selected category or rightclick | Edit.
Tip: You can also manage Categories via the Caption of Categories on
the Workspace.

Toad Data Modeler User Guide

382

Projects and Models

Option

Description

Object
Navigator
Box

All categories of your model are listed here. The combobox allows you to edit them, one by one from one place.
Use Apply to confirm all the changes you make.

General
Tab

Description

Name

Category name

Color

Selected color for appropriate category

Description
Tab

Here, you can write any text description on the category.

Objects
Tab

A list of all entities, views and relationships of your
model. Those that have already been assigned to the
category are listed in the Selected section on the right.

To Do Tab

On this tab, you can write some tasks on the selected
category.
Note: To see all To Do tasks, select Model | To Do.

You can assign entities, views and relationships to category in the Category Properties dialog
and also in the object Properties dialog.
To assign entity to category in the Category Properties dialog
1. Edit the selected category and click the Objects tab. All objects are listed in
alphabetical order.
2. Optional step: Start typing characters to activate filter at bottom of the form.

Toad Data Modeler User Guide
Projects and Models

3. Select the entity and click the Add arrow button.

4.
To assign entity to category in the Entity Properties form
1. Double-click the selected entity (on the Workspace or Model Explorer).
2. Click the General tab in the Entity Properties form.
3. From the Category box, select the category.
Tips:
1. To copy categories, use CTRL + Drag&Drop techniques.
2. To delete categories:
l

In the Category List dialog, select a category and click Delete.

l

Model Explorer | Categories folder | Right-click and select Delete Item.

Related Topics
Caption of Categories and Shortcuts (page 83)
To select more objects on WS by category or schema/owner (page 67)

383

Toad Data Modeler User Guide

384

Projects and Models

Find
To find a particular object (its shortcut) on particular Workspace in your large model, you can
use the following options:
l

Find function
1. Activate the WS in the Application Window.
2. From the Edit menu, select Find (also SHIFT + CTRL + F).
3. Write a name of the searched object to the Object Name box and click OK to
highlight the searched object on the Workspace.

4. Click Cancel or x to close the Find dialog.
l

Model Explorer
1. In Model Explorer, select the object of which shortcut you need to find. | Unfold
its Shortcuts folder. -> Here, all shortcuts of the selected object with a name of
Workspaces where they occur are listed.
or
In Model Explorer, select appropriate WS in the Workspaces folder. | Unfold the
Entity / Relationship / View Shortcuts folder. Here, all entity/relationship/view
shortcuts that occur in selected WS are listed.
2. Select a shortcut and double-click it, or right-click and select Find On Workspace.
-> The Workspace where the shortcut occurs will be activated in the Application

Toad Data Modeler User Guide

385

Projects and Models

Window

l

and

the

shortcut

will

be

highlighted.

Object Viewer
Object Viewer allows you to display a complete list of selected objects of your
model, e.g. attributes, triggers, check constraints, views, etc. with a possibility to
find the object on actual workspace.

Toad Data Modeler User Guide

386

Projects and Models

See "Object Viewer" (page 404) for more information.

Gallery
You can create a new gallery and store frequently used parts of your models into the gallery. Not
only entities can be stored into the gallery, but also single attributes, stored procedures and other
objects can be added. Drag-and-drop technique can be used for inserting gallery items into your
models. You can drag a gallery item and drop it to your workspace or particular folder in
Physical Model Explorer. Every item inserted from the gallery remembers its origin and this
allows synchronizing items in your model with appropriate gallery items. Multiple galleries can
be created and shared among users; the only condition is to place them to a shared folder.

Toad Data Modeler User Guide

387

Projects and Models

The Gallery name, Path to the Gallery and Convertor Options applied for the Gallery
can be editted.

Toad Data Modeler User Guide

388

Projects and Models

Converter Options dialog enables several settings as in the regular Model Conversion wizard.

Individual Gallery items can be also edited on the level of file information on the General tab.

Toad Data Modeler User Guide

389

Projects and Models

Message Explorer
In Message Explorer, you can see hints, errors, warnings and other messages that appear during
your work with Toad Data Modeler.
Message Explorer is by default docked at the bottom of the application window. However, you
can hide or close it at any time.

Toad Data Modeler User Guide
Projects and Models

To open Message Explorer again
»

Select Tools | Message Explorer.

You can sort messages by IDs, date, time and message type. - Simply click the
appropriate column.
Message Explorer versus Log Area
Log area in appropriate forms/dialogs/wizard displays information only on the operation
proceeding in the particular form/dialog/wizard. (Show/Hide Log options are available.)
Message Explorer displays information on all proceeding operations.

Message Explorer Right-Click Options
Right-click the selected message to see the following options:

Option

Description

Details

Displays details on the selected message.
Tip: Double-click the selected message opens the details
too. Use Next and Previous buttons for quick navigation
among messages.

View
Options

Opens the Message Explorer Properties dialog where
you can define:

390

Toad Data Modeler User Guide

391

Projects and Models

Option

Description
l

What information you want to see in the Message
Explorer (Date, Time, Format, Type),

l

Type of messages (Errors, Warnings, Information,
Hints etc.),

l

Path to save the Log.txt file on tab Message
Saving.

Save Messages to File - If this checkbox is selected, the
messages displayed in Message Explorer will be saved to
the Log.txt file continuously. If the checkbox is clear, no
messages are written to Log.txt file.
Overwrite File - If this checkbox is selected, new
messages overwrite old messages. If this checkbox is
clear, new messages are listed after the older messages in
the Log.txt file.
By default, the following path is set up in the Settings
menu | Options | Paths | Message Explorer Log Path:
C:\Documents and Settings\user name\My
Documents\Toad Data Modeler\Log
Clear
Messages

Clears the Message Explorer.

Save
Messages

Opens the Save As dialog via which you can save all
messages to LocalLog.txt file.

Save
Selected
Messages

Opens the Save As dialog via which you can save the
selected messages to LocalLog.txt file.

Note: Undo/Redo cannot be applied here.

Model Explorer
In Model Explorer, you can see all objects that exist in your model.
Model Explorer is by default docked on the left side of the Application Window. However, you
can hide or close it.
To display Model Explorer again
»

Click

on the toolbar or select Window | Model Explorer.

Toad Data Modeler User Guide

392

Projects and Models

The content of Model Explorer depends on type of your model. Example of Physical
Model Explorer

Tip: Start typing characters to activate filter for the items displayed in Physical Model Explorer.
Note: Objects of your model that have the Generate checkbox disabled in their Properties
dialogs are displayed in Model Explorer this way:

Manage Items in Model Explorer
In Model Explorer, you can manage objects of your model easily:

Toad Data Modeler User Guide

393

Projects and Models

l

Manage model and particular Workspaces via the right-click options

l

Manage objects/items - Double-click or Enter the main item in Model Explorer opens
appropriate dialog. Example: Double-click the Procedures opens the Procedures dialog
(same as when you select Model | Model Items |Procedures). The same works for
Entities, Relationships, Views, Functions, Users etc.

l

Add, edit and delete (context menu for multiple selection of objects is available)

l

Copy (CTRL + Drag&Drop techniques)

l

Move (Drag&Drop techniques)

l

Create shortcuts of entities (Drag&Drop techniques to the Workspace)

l

Find shortcuts of objects on the Workspace quickly - Double-click the shortcut in Model
Explorer highlights it on the Workspace.

Copy and Move
You can copy/move the items:
l

In Model Explorer itself (on particular folders)

l

From Model Explorer to Workspace

l

Between Model Explorer and particular dialog/form (e.g. Entity Properties form)

l

Between Model Explorers of two different models

Tip: Searching in the tree of Model Explorer: When you need to find an object, e.g. entity, in
Model Explorer, simply expand the Entities folder and start typing the entity name. It will be
found at once. - This function works for expanded folders (search will not go through folders
that are collapsed).

Right-Click Options in Model Explorer
Right-click the Model Explorer to see the following options:
Option

Description

Sort by
Name

Sorts all items in Model Explorer alphabetically.

Expand All

Unfolds all folders.

Collapse
All

Rolls up all folders.

Settings

Enables you to set up background color of Model
Explorer.
Use Colors of Category to Draw - If this checkbox is
selected, names of entities that have been assigned to a

Toad Data Modeler User Guide
Projects and Models

Option

Description
category are colored with the category color in the tree of
Model Explorer.

Right-click the Model Name in Model Explorer:
Option

Description

Add
Workspace

Creates a new workspace (WS) in the model. The new
WS automatically opens in the Application Window
and the Workspace Properties dialog opens too. In
this dialog, you can define the name of the WS and
description.
Note: To disable this function, select Settings |
Options | General and clear the Open Workspace
Properties Dialog after Add Workspace checkbox.

Model
Properties

Opens the Model Properties dialog.

Save

Saves the model.

Save as

Allows you to save selected model to another file.

Object Viewer

Allows you to display a complete list of objects, e.g.
attributes, triggers, check constraints, views, etc. with
a possibility to open the Properties dialog of the
selected object.

Add to Project

Adds model to selected Project.

Add to
Version
Manager

Allows you to add the model to Version Manager.

Sync &
Convert
Wizard

Opens the Sync & Convert Wizard.

Sort Tree
Alphabetically

Sorts all items in the tree (under main folders)
alphabetically.

Rename

Renames the model.

Close Model

Closes the selected model.

In Expert Mode, the following options are available: (See Expert Mode

394

Toad Data Modeler User Guide
Projects and Models

Option

Description

for more information.)
Test Model

Runs internal test of model consistency.

Repair Model

Can fix 60 % of problems found during the Test
Model.

Right-click the Workspaces to see the following options:
Option

Description

Add
Workspace

Creates a new workspace (WS) in the model.

Open All
Designers

Opens Designers of all existing Workspaces for the
selected model.

Sort
Alphabetically

Sorts all Workspaces of the model alphabetically.

Right-click the name of particular Workspace to see the following options:
Option

Description

Activate
Designer

Activates already opened Designer of the selected
WS, or opens Designer for this WS in Application
Window.

Open Designer

Opens another Designer for the selected WS in the
Application Window.

Edit...

Opens the Workspace Properties dialog where you
can define the name of the WS and description.

Workspace
Format

Opens the Workspace Format dialog.

Add All Model
Objects to
Workspace

Adds shortcuts of all objects of the model to the
selected WS.

Copy Workspace

Creates a new copy of the selected workspace.

Add Object to
Gallery

Adds the workspace with all the items to a Gallery.

Macros

Shows available macros.

395

Toad Data Modeler User Guide

396

Projects and Models

Option

Description

Rename

Renames the selected WS.

Delete
Workspace

Deletes the selected WS from model.

Right-click the main tree item, e.g. Entities:
Option

Description

Add

Adds a new item (entity).

Edit...

Opens the object Property dialog (e.g. the Entity
Properties form).
Note: Available also from the Model | Model Items
menu.

Sort
Alphabetically

Sorts all sub-items alphabetically.

Note: In Attributes, Sort by Nature Order option is available in the context menu and enables
sorting the attributes in the order as they were created.

Related Topics
A. Drag&Drop techniques + CTRL on the Workspace (page 94)
Move EntitiesIn Toad Data Modeler there are several methods how to move entities. You can
select from the following options.To move entities within a Workspace, useDrag&Drop
techniquesorKeyboard arrowsTips:Select Settings | Options | Graphics | Move Objects by
(mm/10) to set up the size of a step to move (in tenths of millimeters).Select an entity, press
SHIFT, hold it down and use the keyboard arrows to change size of the entity box. To move
more entities on the WS at one jumpMake multiple selection of entities. See "Select Objects
Physical Model Pointer and Objects Selection tool optionsLogical Model Pointer and Objects
Selection tool optionsMetamodel Pointer and Objects Selection tool optionsSelect Links
Automatically—also available from Objects menu. By default enabled. When enabled,
lines/relationships between selected objects are selected automatically. During one selecting
process you can enable and disable this option several times to select only certain
lines/relationships. To select multiple objects on Workspace, you have the following
options:Press SHIFT and click the particular objects on WS. This option works regardless
settings in Pointer and Objects Selection tool on the toolbar.Drag your mouse over the objects
on WS. (Works only for adjoining objects.)Note: If you drag your mouse from the left side, only
the objects that are entire in the frame will be selected. If you drag your mouse from the right
side, even objects that are partly in the frame will be selected. - See the following
example.Example:You want to select the Customer and Order Record entities. In Pointer and

Toad Data Modeler User Guide

397

Projects and Models

Objects Selection tool, you must set either Select All (relationships will be also selected), Select
Entities or Select All Shapes. Drag your mouse from the left side as long as both entities are
completely in the frame (see the following image).Release your mouse button. Objects have been
selected.The result would be the same if you dragged your mouse from the right side and
included even a small part of the two entities in the frame. Tip: To select all objects on WS,
select Edit | Select All. To select more objects on WS by category or schema/ownerRight-click
the Workspace | Select Objects.Define a category or owner, or category and owner and click
Select. To select child and parent objects of the selected entity on the WorkspaceRight-click
the selected entity and select Select Parent Objects or Select Child Objects or Select Parent and
Child Objects.To select multiple objects in Model Explorer and grids (e.g. Entity Properties form)
Use SHIFT or CTRL keys. Related TopicsObject ViewerSearch Objects" (page 1) for more
information.Point your mouse cursor at any selected object, click and hold the mouse button
down. Drag the objects to the required position. A whole bloc of all selected entities will move,
including their relationships.Tips:In the Objects menu, see the following two options:Select
Links Automatically - Enable this option if you want to select the relationships of related
entities automatically while making the multiple selection via SHIFT key in WS. Recalculate on
Move - Enable this option if you want to recalculate and see position of relationships while
moving the bloc of objects.To move an entity in a straight line, drag it and then press and hold
SHIFT key.To move an entity with its relationship, including handle points, select the entity and
the appropriate relationship (use SHIFT) and drag the entity. -> Selected entity, relationship and
its handle points will move too. To move entities to another Workspace or another model, select
from the following options:Cut&Paste functions: Edit | Cut/Paste, or via shortcuts CTRL+X,
CTRL+VDrag&Drop techniques between the Entities dialogs of two different modelsDrag&Drop
techniques between the Entities dialog and Model ExplorerDrag&Drop techniques in or from
Model ExplorerDrag&Drop techniques between Entities dialog/Model Explorer and
Workspace Example: Moving an entity between two models via Model Explorer. An entity will
be moved from Model A to Model B.Version A: Moving an entity between Model Explorers of
the two models.Open Model Explorers for both models. You can leave them undocked, or at
least one of them to be able to drag the entity between them.Select an entity in Model Explorer
A | Entities folder, and hold the mouse button down.Drag the entity to the Entities folder of the
Model Explorer B. Version B: Moving an entity from Model Explorer A directly to a Workspace
of Model B.Undock the Model Explorer A if it's docked, and click the Workspace tab of Model
B in the Application Window.Select an entity in Model Explorer A and hold the mouse button
down.Drag the entity to a Workspace of Model B. Related TopicsModel Explorer (page 1) (page
1)
Shortcuts of Objects (page 72)

Model Properties
»

Select Model | Properties....

Toad Data Modeler User Guide
Projects and Models

Tab

Description

General

General information on the model (project, model,
author, company, version etc.)

Before Script

Whatever you write on the Before Script tab, it will be
generated before the generated SQL code.

After Script

Whatever you write on the After Script tab, it will be
generated after the generated SQL code.

Description

Notes on the model

398

Toad Data Modeler User Guide

399

Projects and Models

Tab

Description

Naming
Convention

Here you can select a naming convention for the
model.

Database
Parameters

The value in the Length Semantics box shows which
default length semantics (BYTE or CHAR) was set up
in the database for reverse engineering of Oracle
database.
Note: This tab is available only in Oracle models.

Naming
Convention

Here you can link or unlink a naming convention
to/from your model.
Manage Naming Conventions - Opens the Naming
Convention dialog (available also from the Tools
menu)
Edit Naming Convention - Opens the Naming
Convention Properties dialog.

Related Topics
Stamp and Shortcuts (page 83)

Model Statistics
To display details on your model, its Workspaces, objects etc.
»

Select Model | Statistics....

To change some of the General Information (e.g. model name, author or company)
»

Select Model | Properties....

Tip: You can also change it via the shortcut of Stamp on the Workspace - just doubleclick the Stamp.

Related Topics
Stamp and Shortcuts (page 83)

Modeless Dialogs/Forms
In Toad Data Modeler 3.x, you can open several dialogs/forms at one time, switch among them
and work with them concurrently without the necessity to close any of them. This allows you to

Toad Data Modeler User Guide

400

Projects and Models

work with your model fast and comfortably.

Scenario
You've created a new Attribute1 for an entity and started to define its
properties. It is probable that you will need to add another attribute (or
other attributes) later.
1. Select the newly created Attribute1 in the the Entity Properties form and click Edit. The
Entity Properties form remains opened and the Attribute Properties dialog opens.
2. Define properties of the Attribute1.

3. Now you find that you need to create another attribute. You don't have to close the
Attribute Properties dialog but can simply click the Entity Properties form to activate it
and add a new attribute there - click Add in the Entity Properties form.

Toad Data Modeler User Guide

401

Projects and Models

4. Click the Attribute Properties dialog again. From the Object Navigator box,
select the new item Attribute2 to define properties of this attribute.

Tips:
1. For even quicker adding new attributes, you can use the OK+Add button in the Attribute
Properties dialog.
2. While defining properties of an attribute, you can close the Entity Properties form. Later,
if you find you need to create another attribute, you can:
a. Use Model Explorer: right-click the Attributes folder of appropriate entity | Add
Attribute. The newly created item will display in the Object Navigator box in the
still opened Attribute Properties dialog immediately. Feel free to select it and
define its properties.
b. Open the Entity Properties form directly from the Attribute Properties dialog.
Just click

.

Note: Another great example of using modeless dialogs is e. g. defining Users and User Groups.
( See "Users and User Groups" (page 241) for more information.
Instances of Forms
Toad Data Modeler also allows you to open several instances of the same dialog/form. To enable
this option, select Settings | Options | Application section | General and clear the Allow One
Instance of Form option. (The change will be applied also for currently opened model.)

Toad Data Modeler User Guide

402

Projects and Models

What are the advantages of this feature? - For each instance of form/dialog, you can set a
different view, dock them where you want, and undock or close/open when necessary.
Tips:
l

Application View - You work with two models that have a lot of Workspaces. You need
to see all WS for each model. -> You can open AV for each model.

l

Version Manager - Open Version Manager for each project for more comfortable work
with them.

l

Message Explorer - Set up different view filter on messages in each Message Explorer.

l

VM, ME, Script and Package Explorer - Dock the forms to the models where you
need them or use them. Set particular view on items in the forms for each model to
meet your needs.

Example 1: You work with scripts and packages only in Model X. Feel free to dock Package and
Script Explorers to the model. -> It saves place while working with other models. The packages
will be available only for Model X - just where you need them.
Example 2: Open several instances of Message Explorer - for each model. Dock it on particular
models and set a different message view filter for each.

Object Navigator Box
Object Navigator box, together with the modeless dialogs, can ease and speed up your work in
Toad Data Modelersignificantly.
Object Navigator box:
l

Is available in object Properties dialogs and forms (entity, attribute, check constraint,
view, function, users, user groups etc.).

l

Allows you to select items for edit from one (the same) place.

Scenario
You need to edit several entities of your model.
1. Double-click ANY entity on the Workspace (WS) to edit it.

Toad Data Modeler User Guide

403

Projects and Models

2. Click the small black arrow on right top corner.

3. The form navigator area appears on the form.

4. From the Object Navigator box, select the entity you need to edit (Borrowing).
5. Change its properties and confirm Apply. -> The changes will be saved and the Entity
Properties form remains opened.
6. Again, from the Object Navigator box, select another entity you need to edit (Customer).
Confirm Apply to save the changes.
7. Take the same steps until you edit all entities you need.
8. For the last entity, you can confirm the changes OK to close the Entity Properties form.

Feel free to take advantage of this box when editing relationships, procedures, views,
functions, users etc.
Tip: Quick search in the Object Navigator box - To find e.g. particular entity in ERD to edit it,
double-click any entity on the Workspace, expand the Object Navigator box in the Entity
Properties form and simply start typing name of the searched entity. The searched item will be
found in the list. Click it to open its Properties form.

Toad Data Modeler User Guide

404

Projects and Models

Object Viewer
Toad Data Modeler allows you to display a complete list of selected objects of your model, e.g.
attributes, triggers, check constraints, views, etc. with a possibility to open the Properties dialog
of the selected object(s), delete them or find on the Workspace.
To open Object Viewer
»

Click

on the toolbar.

or
Select Window | Object Viewer....
Tip: You can also open Object Viewer from the Model Explorer or the
Application View - right-click the model name and select Object Viewer.
Object Viewer is docked by default on the right side of the Model Explorer.

Toad Data Modeler User Guide
Projects and Models

Option

Description

Object
Name

Type an object name (case sensitive).

Object
Type

Select a type of object.
Select options for the search process in the checkboxes
below.
Tip: Take notice of the option Search in Comments and
Notes Properties (Descriptions) of entities and attributes
(both LER and PER model).
Click this icon to view the objects.

In the list, you can see:

405

Toad Data Modeler User Guide

406

Projects and Models

l

Icon of an object type

l

Physical object name

l

Logical object name

l

Information about parent object

l

Object type (entity, attribute, key, trigger etc.)

Right-click the selected item in the list to display other options (edit, delete, find on Workspace).

Object Types and Properties - OTPs
OTPs (Object Types and Properties) enable you to select objects and properties on various forms,
define default OTPs selection and store and load them.
Example: See the Sync & Convert Wizard, the Select Object Types page, Detailed Settings
button where you can define object types and properties for model compare/merge/conversion. If
a particular object is selected (e.g. entities, relationships, functions etc.), it means you want to
compare the object between the Left model and Right model. (All objects are selected by
default). Clear the checkboxes at particular objects if you do not want to compare them and
therefore ignore the possible changes.
By default, only basic selection of objects and properties is available. Saving, loading and
creating default OTPs are options for Experts.
Note: This option is available only if Expert Mode is enabled.
Object Types and Properties are available in:
l

Reverse Engineering Wizard and Model Update Wizard - What to Reverse page

l

DDL Script Generation dialog - What to Generate tab

l

HTML/RTF Report Wizard - What to Report page

l

Sync & Convert Wizard - Select Object Types page

l

Model Verification - What to Verify tab

Default (System) Selected OTPs versus User Selected OTPs
In Toad Data Modeler there are:
l

Default (System) Selected OTPs
They are stored by default at:
C:\Program Files\Quest Software\Toad Data Modeler\Selected OTPs
They cannot be modified/overwritten.

l

User Selected OTPs

Toad Data Modeler User Guide

407

Projects and Models

They are stored by default at:
C:\Documents and Settings\user name\My Documents\Toad Data Modeler\Installation
name \Selected OTPs
They are preserved during update of Toad Data Modeler.
To set up/change the path for user OTPs, select Settings | Options | Paths | Advanced tab |
Selected OTPs.
Tip: Feel free to share the OTPs with your colleagues!

Define and Save User OTPs
See the differences between the following two dialogs (Expert Mode off versus Expert Mode on).
RE Wizard (Oracle 10g db), What to Reverse page, default OTPs (Expert Mode disabled):

What to Reverse page, OTPs options (Expert Mode enabled):

Toad Data Modeler User Guide

408

Projects and Models

In this dialog, you can see options for managing OTPs:
Option

Description
Select an OTP.

Saves the changed OTP settings to the
OTP selected in the Selection box (either
resaves the current OTP or overwrites
another OTP).
Loads OTP settings of the OTP selected
in the Selection box.
Saves the selection to a new OTP (similar
to Save as).
Define a name of the new OTP and press
OK.
After you click OK, the OTP will be
saved to .txo file to particular database
(Oracle 10g.txo in our example).

Toad Data Modeler User Guide

409

Projects and Models

Option

Description
Deletes the selected OTP.
Click Yes to delete the OTP from the .txo
file of particular database (Oracle 10g.txo
in our example).
Sets the selected OTP as default.

Note: The OTP options are the same also in other dialogs and wizards e.g. DDL Script Generation dialog or Report Wizard etc.

Save User OTPs
Each database supported in Toad Data Modeler has its .txo file (Oracle 10g.txo, MS SQL Server
2005.txo etc.).
Default (System) Selected OTPs are stored by default at: C:\Program Files\Quest Software\Toad
Data Modeler\Selected OTPs.
As soon as you install Toad Data Modeler, the default .txo files will copy to the user section at:
C:\Documents and Settings\user name\My Documents\Toad Data Modeler\Installation
name\Selected OTPs. Here, you can store your user OTPs that will be preserved during update of
Toad Data Modeler.
New OTPs, which you create, will be saved in .txo file of the particular database.
Example:
You create a new OTP in the DDL Script Generation dialog for your Oracle 10g model and
save it. This OTP will be saved to Oracle 10g.txo. This OTP will be available in the Selection
box in the DDL Script Generation dialog for all Oracle 10g models for which you need to
generate SQL script. (OTPs are saved separately for every dialog, which means that OTPs defined
in DDL Script Generation dialog will not be available in Model Verification dialog etc.)
If you want to save this OTP to a particular model, you have to click Save Settings. The OTP,
including other settings defined in the DDL Script Generation dialog, will be saved within a
model. Next time, when you open the DDL Script Generation for the model, the OTP will be
selected automatically. If you didn't click Save Settings, you would have to select the OTP and
load it again.
Available OTPs Dialog
To see a list of all OTPs available in your model
»

Select Expert Mode | Expert Mode Settings menu | Available OTPs.
Note: This option is available only if Expert Mode is enabled.

Toad Data Modeler User Guide

410

Projects and Models

This option is available for real experts interested in writing their own support for new database
systems or for people who need to enhance existing support for the selected database system.

Quick Search
To quickly find an object in your model or on your workspace:
1. Press CTRL + F
2. Type object name or caption, or part of object name or caption.
3. Use arrow down key on your keyboard to select item in result set.
4. Press Enter to perform Edit or Find on Workspace action.

Standard Search
When you search for object, write part of the name or caption to the first field.

Wildcards
Available wildcards are * and ? characters. (The star wildcard at the end of search term is
not required).

Toad Data Modeler User Guide

411

Projects and Models

Word Recognition
If you use underscores in names, you can type just first characters of the words to refine search.
The following example shows search results of string tcr. Results include T_
CUSTOMER_RATING.
Underscore characters was used as word delimiter.

Similar functionality is available for search in captions where space is used as word delimiter.
You can partially combine the standard search with word recognition based search.

Toad Data Modeler User Guide

412

Projects and Models

Camel Case
In case your objects are defined using CamelCase, type just the characters you expect to be in
uppercase.
Example: To find EventLogConfig, search for elc.

Dot Notation
Define object name and type . character to display child items of the object. The dot notation
works for schemas as well.

Toad Data Modeler User Guide

413

Projects and Models

Actions
Select item in result set and press Enter to perform suggested action or click Arrow button next
to the suggested action button and choose either Edit or Find on Workspace.

Toad Data Modeler User Guide

414

Projects and Models

Find
To find a particular object (its shortcut) on particular Workspace in your large model, you can
use the following options:
l

Find function
1. Activate the WS in the Application Window.
2. From the Edit menu, select Find (also SHIFT + CTRL + F).
3. Write a name of the searched object to the Object Name box and click OK to
highlight the searched object on the Workspace.

4. Click Cancel or x to close the Find dialog.
l

Model Explorer
1. In Model Explorer, select the object of which shortcut you need to find. | Unfold
its Shortcuts folder. -> Here, all shortcuts of the selected object with a name of
Workspaces where they occur are listed.
or
In Model Explorer, select appropriate WS in the Workspaces folder. | Unfold the
Entity / Relationship / View Shortcuts folder. Here, all entity/relationship/view
shortcuts that occur in selected WS are listed.
2. Select a shortcut and double-click it, or right-click and select Find On Workspace.
-> The Workspace where the shortcut occurs will be activated in the Application

Toad Data Modeler User Guide

415

Projects and Models

Window

l

and

the

shortcut

will

be

highlighted.

Object Viewer
Object Viewer allows you to display a complete list of selected objects of your
model, e.g. attributes, triggers, check constraints, views, etc. with a possibility to
find the object on actual workspace.

Toad Data Modeler User Guide

416

Projects and Models

See "Object Viewer" (page 404) for more information.

Search Items
Search Items in Trees and Grids
The quick search function is available in the list of items in the Object Navigator box, in grids e.g. Entities dialog, and in all trees in Toad Data Modeler- e.g. in the Application View, Model
Explorer, Version Manager, Script Explorer, Package Explorer etc. This function works only for
expanded folders (the search will not go through folders that are collapsed).
Example: When you need to find e.g. a particular entity in Model Explorer, simply expand the
Entities folder and start typing the entity name. It will be found at once. This way, you can find
particular project or file in Version Manager, model or Workspace in the Application View,
script in Package or Script Explorer etc. To find particular entity in ERD to edit it, double-click
any entity, expand the Object Navigator box in the Entity Properties form and simply start
typing the name of the searched entity.

Search Objects in ER Diagram

Scenario

Toad Data Modeler User Guide

417

Projects and Models

You need to find an entity of which whole name you don't remember.
You only know there is a word "rating".
You know on which Workspace (WS) the entity is. OR Your model has
only one WS.
1. Open the model and activate particular Workspace.
2. Press CTRL+SHIFT+F (Edit menu | Find).
3. Type the entity name.
You can use e.g. the following search string: *rating or only rat*, *ting etc.
Other search string: ?rating
* - for unlimited number of characters,
? - for one character.
4. Define the options for search. Remember that Compare to Name refers to a physical view
(searches among physical names on the WS) and Compare to Caption to a logical view
(searches among logical names on the WS). See what view is displayed on the WS or
select the third option for sure - Compare to Name or Caption.
5. If you know there are several entities containing the name "rating" OR there are several
shortcuts of the entity on one WS, you can select the Find All checkbox.
6. Confirm OK.
Result: The entity shortcut is found on the WS and highlighted.
If there are more entity shortcuts that match the searched term, press Next to
skip to another.
Note: The Find function searches objects only on current Workspace.

Scenario
You know the entity name or at least how it begins.
You don't know on which WS the entity is. OR The entity shortcut is on
more workspaces.
1. Open the model. Its Model Explorer should open automatically. (Otherwise select Tools
| Physical Model Explorer.)
2. Expand the Entities folder in Model Explorer. You need to find entity tab_Order Record.
The entities are sorted as they were created. If you want to sort the items in Model
Explorer alphabetically, right-click the Model Explorer and select Sort by Name.
3. Start typing the entity name, e.g. "t". Cursor will switch to entity of which name begins
with "t". Continue typing "tab_O" and see the searched entity finally.
4. Select the entity and expand the entity folder.

Toad Data Modeler User Guide

418

Projects and Models

5. See folder Shortcuts. Here all shortcuts of the particular entity are listed. You can see
information on which Workspaces, and also a number of the shortcut if there are more of
them on one WS.
6. Select the particular shortcut from particular WS and double-click it.
Result:
If the WS is not active, it will open and the selected shortcut will be highlighted. (If
it is not the entity shortcut you wanted, feel free to double-click another one in
Model Explorer.)

Select Objects in ERD by Schema or Category
1. Right-click the Workspace and select Select Objects.
2. Define a category or owner or category and owner and click Select. All objects that
match your settings will be selected on the Workspace.

To Do List
To-Do List allows you to keep records of tasks and make notes on unfinished actions.
You can assign tasks to:
l

Particular object of your model in its Properties dialog (see the Entity Properties form |
To Do tab)

l

Main To Do dialog - see the Model menu | To Do (A complete list of all To Do items
can be found here.)

- Hides/shows To Do items that were entered out of the To Do dialog.
In Toad Data Modeler, you can assign tasks to the following objects:

Toad Data Modeler User Guide

419

Projects and Models

Model, Entity, Relationship, Attributes, Keys, Indexes, Check constraints, Triggers, Users, User
groups, Dictionary Types, User Data Types, Domains, Defaults, Rules, Views, Procedures,
Schemas, Categories, Metamodels.
Tip: Toad Data Modeler allows you to generate a To Do report. See "XSL Transformation" (page
324) for more information.
To add a new To Do item
»

Select Model | To Do | Add.

Note: Or edit the object (e.g. entity) and in the Properties dialog, click To Do tab | Add.
To edit a To Do item
»

Select Model | To Do | double-click the selected item.

Note: To delete a To Do item, select the item and press Delete.

Toad Data Modeler User Guide

420

Projects and Models

General
Tab

Description

Name

Task name

Priority

Task priority

Category

To logically divide your To Do items, you can define
categories for them. Simply write a category name to the
Category box.
The existing categories will be available here via a dropdown menu for other To Do items as well.

Date of
Creation

Date when the task has been entered to To Do.

Deadline

Date when the task should be accomplished.

Completed

If selected, the task has already been accomplished.

Text

On this tab, you can write a text description on particular
task.

Undo, Redo Functions
These functions allow you to undo and redo steps during your work with models and packages.
Example: You deleted an entity on the Workspace by mistake (SHIFT + Del), however wanted
to remove only the entity shortcut from the Workspace. Click Undo to display the entity in your
model again. If you click Redo then, the entity will be deleted again.
The Undo and Redo functions are available via the Edit menu or via toolbar icons.
To set up number of steps back
»

Select Settings | Options | Application section | General | Number of Undo/Redo Steps.

Where Can You Use These Functions?
l

During your work with models on the Workspace, in Application View and
Model Explorer.

l

During your work with models in forms and dialogs (e.g. the Entity Properties form). The
functions will always return to a state before the confirmation OK or Apply.

l

During your work with packages and scripts in Package and Script Explorers.

Undo/Redo are not available while working with versions in Version Manager.

Toad Data Modeler User Guide

421

Projects and Models

Open Toad Data Modeler 2.x Models or CASE Studio 2 files
In Toad Data Modeler 3.x, you can open your models created in Toad Data Modeler 2.x - *.dm2
and *.dmx files.
To open a file created in Toad Data Modeler 2.x
1. In Toad Data Modeler 3.x, select File | Import | CASE Studio 2 file...
2. From the Files of type box, select item Toad Data Modeler version 2.x Model in binary
format (*.dm2) or "Toad Data Modeler version 2.x Model in XML format (*.dmx).
3. Select the file and click Open.
4. Resave the file in Toad Data Modeler 3.x format. - Select File | Save Model as.
5. From the Save as type box, select item Physical Toad Data Modeler Models in XML
Format (*.txp).
6. Click Save.
Note: In Toad Data Modeler 3.x, you can open files of only those databases that are supported
by both applications - Toad Data Modeler 2.x and Toad Data Modeler 3.x as well. At the
moment Toad Data Modeler 3.x doesn't support all DB types supported in Toad Data Modeler
2.x. However, we keep working on this. See "Supported Databases" (page 658) for more
information on currently supported database systems.

Import of Toad Data Modeler 2.x Macros
Toad Data Modeler 2.x macros are not imported to Toad Data Modeler 3.x. Toad Data Modeler
2.x macros are in fact Toad Data Modeler 3.x application variables. See "Features" (page 374) for
more information.

Import of To-Do Items
It is possible to import To Do items of your .dm2 model to Toad Data Modeler 3.x.

Import of User-defined Variables
In Toad Data Modeler 2.x , you could define user-defined variables on the Editor of Variables
tab in the Templates Editor. Via them, you could add some options on the Advanced tab of
objects in your model.
User-defined variables are not imported to Toad Data Modeler 3.x automatically and some steps
are necessary to be taken. As it is not so quick and easy, we will make a separate documentation
on this issue. (Please visit our Modeling Community site for update. Thank you.)

Toad Data Modeler User Guide

422

Projects and Models

Import of User-defined Templates (.TE2 files)
In Toad Data Modeler 2.x , you could modify system templates the way that you copied selected
system template to the user-defined section. This way, you created new .te2 files.
Unfortunately, automatic import of these templates to Toad Data Modeler 3.x is not possible.
The principle of how templates and scripts in Toad Data Modeler 3.x work is completely
different from the system used in Toad Data Modeler 2.x .
Note: Import of .DMX file to Toad Data Modeler 3.x: If there is an error in the XML file
(.DMX) and the XML file is not valid, Toad Data Modeler 3.x cannot open it. Firstly, check
out if your XML file is correct (e.g. in FireFox) and fix possible bugs (e.g. in Notepad++). If
the XML file is correct and Toad Data Modeler 3.x still cannot open it, please contact the
Quest support team for help.

Conversion
Data Type Conversion Settings
Before you start the conversion process, you can set up conversion settings for data types.
1. Enable Expert mode: Select Settings | Options | General | select the Expert
Mode checkbox.
2. Select Expert Mode | Expert Mode Settings | Data Type Conversion Settings.

Toad Data Modeler User Guide

423

Projects and Models

3. From the Source and Destination boxes, select database systems or Logical Model item
that you want to convert your model to.
4. Press

to display data types. Click

to view only exceptions.

You can see a list of data types of source model and information on how they will be
converted in the destination model.
Example: Oracle Blob data type will be converted to MS SQL Server 2005 model
as Image data type. Feel free to click the Destination data type item, press F2 and
change it at your convenience.
Note: The modified database conversion settings will be saved to
DataTypeConversion.txn file stored by default at: C:\Documents and
Settings\user\Application Data\Quest Software\Toad Data Modeler\Installation
name\Configs. If you want to restore the original conversion settings, you need to
delete this .txn file.
5. Confirm OK.
Execute Script Checkbox
If you want to use scripts for data type conversion, select the checkbox in the Execute Script
column, create script ConversionDataType and write function for the data type conversion to the

Toad Data Modeler User Guide
Projects and Models

script.
Example:
function Convert(){
  var Log = System.CreateObject('Log');
  Log.Information('Konverze');
  Log.Information('Input MD: '+ InputModelDef.Abbrev );
  Log.Information('Output MD: '+ OutputModelDef.Abbrev );

  Log.Information(InputDataType.ConversionID.Code);

  var outDT
  if (InputDataType.ConversionID.Code == 'C_X'){
   Log.Information('HERE');
    for(  
 
i = 0; i < OutputDataTypes.Count; i++ )
{  
 
      outDT = OutputDataTypes.GetObject( i );
      Log.Information(  
 
outDT.Name );
      if (outDT.Name=='Box') {
        return(i);
      }
    }
  }

  return(0);
}

Related Topics
PER - PER Conversion Information (page 425)
PER - LER Conversion Information (page 428)

424

Toad Data Modeler User Guide

425

Projects and Models

PER - PER Conversion Information
See some basic information on what is converted and how during the PER to PER conversion.
l

Data Types are converted.

l

Permissions are compared by names.

l

SQL code is copied and commented not to generate any code.

See other details here:
Item to
Convert

Model A

Model B

Result

(Source
Model)

(Destination
Model)

Supported
data type

Supported
data type

Same data
type

Integer

Integer

Integer

Supported
data type

Equivalent
data type

Equivalent
data type

Float

Real

Real

Supported
Permission

Supported
Permission

Same
Permission

SELECT

SELECT

SELECT

Supported
Permission

Unsupported
Permission

--None--

DROP
(MySQL 5)

--None-(MS SQL
2005)

--None-(MS SQL
2005)

Unsupported
Permission

Supported
Permission

Model B
Permission

--None-- (MS
SQL 2005)

DROP
(MySQL 5)

DROP
(MySQL 5)

Data Types

Example*:

Example**:
Permissions

Example:

Example:

Example:

(DROP
preserved in

Toad Data Modeler User Guide

426

Projects and Models

Item to
Convert

Model A

Model B

(Source
Model)

(Destination
Model)

Result

already
existing
model.)
Deny Permission

Example:

Deny
Permission
Supported

Deny
Permission
Supported

Deny
Permission
Converted

Deny
Permission
Supported

Deny
Permission
Unsupported

--None--

Deny
Permission
Unsupported

Deny
Permission
Supported

Model B
Deny
Permission

MySQL 5

MS SQL
2005

MS SQL
2005 (Deny
permission
preserved in
already
existing
model.)

Grantor
Supported

Grantor
Supported

Grantor
Converted

Grantor
Supported

Grantor
Unsupported

--None--

Grantor
Unsupported

Grantor
Supported

Grantor is
empty.

MySQL 5

MS SQL
2005

MS SQL
2005
(Grantor
preserved in
already

Grantor

Example:

Toad Data Modeler User Guide

427

Projects and Models

Item to
Convert

Model A

Model B

(Source
Model)

(Destination
Model)

Result

existing
model.)
Users and User Groups

Example:

Supported

Supported

Converted
successfully

Supported

Unsupported

--None--

Unsupported

Supported

--None--

Users
unsupported
in
PostgreSQL

Users
supported in
MS SQL
2005

--None--

Model A - Currently opened model that you want to convert.
Model B - Model to which you want to convert Model A.
Complete Model A is converted to Model B.
Other Information
l

Conversion between PostgreSQL and MS SQL: Serial and BigSerial data types in
PostgreSQL are converted to Identity in MS SQL. Identity in MS SQL is converted to
combination of sequence and default "nextval" in PostgreSQL. 

l

Conversion between PostgreSQL and MySQL: Serial data type in PostgreSQL is
converted to Autoincrement in MySQL. Autoincrement in MySQL is converted to
combination of sequence and default "nextval" in PostgreSQL.

l

Conversion between PostgreSQL and Oracle: Serial and BigSerial data types in
PostgreSQL are converted to combination of sequence and a sequence selected for
attribute in Oracle. A sequence selected for attribute in Oracle is converted to default
"nextval" in PostgreSQL (the sequence is converted automatically).

l

Conversion from Oracle to MS SQL (and MS SQL to Oracle): Automatic conversion of
Identity in MS SQL to Sequence in Oracle (and back).

l

Conversion from Oracle to MySQL (and back): Sequence in Oracle are converted to
Autoincrement in MySQL (and back).

l

Conversion from MS SQL to MySQL (and back): During conversion of Identity (MS
SQL) to Autoincrement (MySQL) and back the new IdentitySeed/Initial Autoincrement is

Toad Data Modeler User Guide

428

Projects and Models

taken into consideration. (In version 3.4, only conversion between checkbox Identity and
Autoincrement was possible.)
l

Model Conversion from MySQL to MSSQL and Oracle: MySQL Enum data type is
converted to Char data type, a check constraint for the attribute is created, the parameter
is preserved (see the SQL tab of the Check Constraint Properties dialog).

* Data types conversion examples - conversion from MySQL 5 model to SQL Server
2005 model.
** See the equivalent data types for conversion in the Settings menu | Data Type
Conversion Settings.

Related Topics
Convert Model (page 431)
Convert Physical Models (PER)Toad Data Modeler allows you to convert:PER model into a
model of another database systemPER model to LER model and vice versaClick Model |
Conversion...to open Sync & Convert Wizard.See "Sync & Convert Wizard" (page 1) for more
information.See "Simple Model Conversion" (page 1) for more information. ScenarioConvert your
Oracle 10g model Videorental to MS SQL 2008. Use the Sync & Convert Wizard. Click on the
toolbar to open the Sync & Convert Wizard.On the Action page, select Convert Model to
Another Target Database System.On the Select Left Side page, select File (*.txp, *.txl). Click the
button on the right to find model Videorental in the Open dialog.On the Select Right Side page,
select a target database system MS SQL 2008.On the Settings page, select Comment Out
Database Specific Items.Tip: You can select whether you want to comment the database specific
items or not. If you converted your Oracle 10g model to Oracle 11g, you would clear this
checkbox not to comment them.On the Select Object Types page, select Convert All.On the
Select Items page, you can select/deselect particular items of your model that you want or do not
want to convert. Leave the default selection to convert all items of model Videorental.On the
Review page, see the statistic information and define a model name for the converted model in
the New Model Name box - Videorental_Converted.Click Finish.The Sync & Convert Wizard
closes and the new model Videorental_Converted of MS SQL 2008 database opens in the
Application Window automatically. Note: Please read the User Guide for more examples on
model conversion. Related TopicsPER - PER Conversion Information (page 1)PER - LER
Conversion Information (page 1)Sync & Convert Wizard (page 1)Simple Model Conversion
(page 1)Conversion to Physical Model (page 1) (page 1)
PER - LER Conversion Information (page 428)

PER - LER Conversion Information
See the following basic information on what is converted during PER to LER and LER to PER
conversion and how.

Toad Data Modeler User Guide

429

Projects and Models

Item to
Convert

Notes:

PER - LER
Conversion

LER - PER
Conversion

Data Types

Similar to PER to
PER conversion.

The conversion
rules should be
defined in the Data
Types Conversion
Settings dialog.

The conversion
rules should be
defined in the
Data Types
Conversion
Settings dialog.

Self
Relationship

In PER model,
only nonidentifying self
relationship is
supported.

Self relationship is
converted properly.

Identifying self
relationship will
change to nonidentifying self
relationship.

Cardinality

In PER model,
cardinality of one
side of
relationship is
1..n.

Cardinality is
converted properly.

E.g. 2..5 cardinality
in LER model is
converted to 1..5 in
PER model.

Parent Key

Parent key can be
defined in LER
model.

Parent key in PER
model is different
than PK (altenate
key, unique
attribute or index).
-> Parent key
defined in PER
model is converted
to LER model
properly.

Selected UI of LER
model is converted
to PER model (PK
and appropriate
alternate keys are
created).

No FKs are
displayed in child
entity in LER
model.

FKs that are not
displayed in LER
model are visible
in child entity in
PER model.

In LER model,
open the
Relationship
Properties dialog
| General tab |
Foreign Unique
Identifier box.
(In PER model,
Parent Key is
defined in the
Relationship
properties dialog |
Foreign Keys
tab.)
Foreign
Keys

In LER model,
keys are not
transferred from
parent to child
entity.

Toad Data Modeler User Guide

430

Projects and Models

Item to
Convert

Notes:

Primary
Keys

PER - LER
Conversion

LER - PER
Conversion

PK (Primary key) in
PER -> PUI
(Primary unique
identifier) in LER

PUI (Primary
unique identifier)
in LER -> PK
(Primary key) in
PER

Alternate
Keys

You can select
alternate key as a
parent key.

AK (Alternate key)
in PER -> UI
(Unique identifier)
in LER

UI (Unique
identifier) in LER > AK (Alternate
key) in PER

NN versus
M
Attributes

NN - Not Null in
PER model.

NN -> M

M -> NN

M - Mandatory in
LER model.
The values can be
displayed in ER
diagram.

Inheritance

Inheritance is not
supported in PER
model.

--

Conversion of
inheritance to PER
model will be
executed by the
rules set up in the
Inheritance dialog
| Generation tab.

Valid
Values in
Attribute

Valid values are
supported only in
LER model.

--

Default values in
LER model ->
Check constraints
in PER model.

They can be
defined for the
following data
types: Bigint,
Float, Integer,
VarChar.
Defaults for
Attributes
and
Domains

(Check constraints
from PER model
are not converted
to LER model.)

Converted properly.

Converted
properly.

Toad Data Modeler User Guide

431

Projects and Models

Item to
Convert

Notes:

PER - LER
Conversion

LER - PER
Conversion

Rules for
Attributes
and
Domains

In LER model,
attributes and
domains can have
rules.

Attribute check
constraint has rules
in PER model. ->
Rules for this
attribute are
converted to LER
model.

Attribute has rules
in LER model. ->
Check constraint
with this rule for
the attribute is
available in PER
model.

In PER model,
attributes and
domains have
check constraints
and these check
constraints can
have rules.

LER to PER Conversion - Self-Relationship
If there is a self-relationship in LER model, the entity has two columns, both of the same name
(primary key), in converted PER model. Other modifications are necessary.
Possible solution: You can define a name for the propagated attributes in LER model before the
conversion. Open the Attribute Properties dialog | General tab | enter the name to the
Propagated Name box.
If this box is empty, Toad Data Modeler will behave standardly (two columns of the same name
in PER model).
Note: It is also possible to set up a self relationship attribute name and caption for PER model in
Settings | Options | Physical Model | Self Relation Attribute Name, Caption.

Related Topics
Convert Model (page 431)
Conversion to Physical Model (page 310)
PER - PER Conversion Information (page 425)

Convert Model
Toad Data Modeler allows you to convert:
l

PER models from one database system to another database system (e.g. Oracle 10g model
can be converted to SQL Server 2008 model)

l

PER model to LER model - to create a new logical model from the existing PER model

l

LER model to PER model - to create a new physical model from the existing LER model

Toad Data Modeler User Guide

432

Projects and Models

The conversion can be executed via:
l

Sync & Convert Wizard

l

Simple Model Conversion

Both options are available at:
»

File | Synchronization |Sync & Convert.

Conversion is accessible also via the Model menu. Click Model | Convert... to open the Sync
and Convert Wizard.
See "Sync & Convert Wizard" (page 438) for more information
See "Simple Model Conversion" (page 434) for more information
To convert your model in the Sync & Convert Wizard
1. Click

on the toolbar.

2. On the Action page, select Convert Model to Another Target Database System.
3. Go through other pages of the wizard.
Note: Please read the User Guide for more examples on model conversion.

Sync & Convert Wizard, Select Items Page
On the Select Items page, you can select/deselect items of your model that you want or do not
want to convert - select or clear the particular checkboxes.
Example:

Toad Data Modeler User Guide
Projects and Models

Option

Description
Expand All
Collapse All
Refresh Necessitated Items
Explanation: Some objects are related together (e.g. entity and
domain, entity and relationship). Once you clear the Action box for
particular entity, the related items will be deselected too. Not to
see them in the list, click Refresh Necessitated Items. The list will
be refreshed and the needless items will be removed.
Opens the Wildcard Dialogwhere you can define settings for bulk
selection/deselection of the Action box of the items listed on page
Select Items.

Display options.

The selected checkbox at particular item says: "Convert this item."
All items are selected by default.

433

Toad Data Modeler User Guide

434

Projects and Models

Related Topics
Convert Physical Models (PER)Toad Data Modeler allows you to convert:PER model into a
model of another database systemPER model to LER model and vice versaClick Model |
Conversion...to open Sync & Convert Wizard.See "Sync & Convert Wizard" (page 1) for more
information.See "Simple Model Conversion" (page 1) for more information. ScenarioConvert your
Oracle 10g model Videorental to MS SQL 2008. Use the Sync & Convert Wizard. Click on the
toolbar to open the Sync & Convert Wizard.On the Action page, select Convert Model to
Another Target Database System.On the Select Left Side page, select File (*.txp, *.txl). Click the
button on the right to find model Videorental in the Open dialog.On the Select Right Side page,
select a target database system MS SQL 2008.On the Settings page, select Comment Out
Database Specific Items.Tip: You can select whether you want to comment the database specific
items or not. If you converted your Oracle 10g model to Oracle 11g, you would clear this
checkbox not to comment them.On the Select Object Types page, select Convert All.On the
Select Items page, you can select/deselect particular items of your model that you want or do not
want to convert. Leave the default selection to convert all items of model Videorental.On the
Review page, see the statistic information and define a model name for the converted model in
the New Model Name box - Videorental_Converted.Click Finish.The Sync & Convert Wizard
closes and the new model Videorental_Converted of MS SQL 2008 database opens in the
Application Window automatically. Note: Please read the User Guide for more examples on
model conversion. Related TopicsPER - PER Conversion Information (page 1)PER - LER
Conversion Information (page 1)Sync & Convert Wizard (page 1)Simple Model Conversion
(page 1)Conversion to Physical Model (page 1) (page 1)
Conversion to Physical Model (page 310)
Sync & Convert Wizard (page 438)
Simple Model Conversion (page 434)

Simple Model Conversion
This feature allows you to convert your logical models to physical models and your physical
models to models of another database system very quickly.

Scenario
You want to convert your Oracle 10g model to MS SQL Server 2005.

1. Open your Oracle 10g model.
2. Select File | Sync & Convert | Simple Model Conversion.
3. Define the settings in the Conversion dialog.

Toad Data Modeler User Guide

435

Projects and Models

Option

Description

To
Database

Select a target database system - MS SQL
Server 2005.

New
Model
Name

Define a name for the converted model.

More>>

Click this button to see and modify Object
Types and Properties for the conversion. No
modification is necessary. See "Object Types
and Properties - OTPs " (page 406) for more
information.

Close after
Conversion

Select it to close the Conversion dialog after
the process is finished.

Convert

Executes the process of conversion.

Close

Closes the Conversion dialog.

4.  Click Convert.

Related Topics
Sync & Convert Wizard (page 438)
Convert Model (page 431)
Simple Model Merge (page 461)

Synchronization
Synchronization
Toad Data Modelerhelps you with synchronization tasks and allow you to generate SQL scripts
for changes made to your model as well as transfer differences found in your database to your
existing physical models. The main purpose and benefit of synchronization features is in the
possibility to keep, during your database development process, your model and dev. version of
your database synchronized and up-to-date.
Database and Model Synchronization
Situation A - Generation of Alter Scripts

Toad Data Modeler User Guide

436

Projects and Models

You have made changes in your physical ER diagram in Toad Data Modeler and need to apply
the changes in your database.
Solution: Compare the models and generate Alter Scripts in Toad Data Modeler. Then use a
third party software to connect to your database and execute the script generated in Toad Data
Modeler in your database. (Note: Alter script generation is not supported for all databases.)
Situation B - Model Update
You or someone else made changes in your existing database (development version of database)
and you need to transfer the changes to your model.
Solution: Use the Model Update or Model Merge features to update your physical model.

Physical Model and Logical Model Synchronization
You have created a Logical model in Toad Data Modeler and You need to convert the logical
model to physical model for the selected database system.
Solution: Use the Sync & Convert Wizard or Simple Model Conversion feature for logical
(LER) to physical (PER) model conversion.
Note: If you make changes in your LER model and need to update the existing PER model,
perform the LER to PER conversion again and then compare the two PER models.
Limitations
There are many factors that affect synchronization features in Toad Data Modeler. For example:
l

Data types can be defined through logical types that do not exist in physically existing
databases, Domains, Dictionary Types etc. Toad Data Modeler must correctly resolve the
data types when comparing attributes (table columns) properties.

l

Objects must be paired by specific rules, for example in your Oracle Database model,
schema assignment is not required, but in your database, schema is always present.

l

There can be application variables defined in your models, for example
<%ParentTableName%> and the application variables must be resolved during the
comparison as well.

In result, the synchronization of your model and your database is more complicated than
comparison of two physically existing databases. From technical point of view, the comparison is
based on more complicated algorithm that requires more resources.
Recommendations
l

Use the synchronization features on models of smaller or average size. If you work with
large models, try to split the model to smaller parts (smaller separate models), if possible.

l

For comparison and synchronization of two larger physically existing databases, use
specialized software. Theoretically you can reverse engineer both databases and create

Toad Data Modeler User Guide

437

Projects and Models

two models, compare them and try to generate change scripts, but due to limitations
mentioned above the process will require more resources and will take longer. Other
products that do not work with models, e.g. Toad for Oracle, Toad for SQL Server and
others can offer you better performance and additional benefits - like comparison of
physical properties and data. Toad Data Modeler is a tool for visual creation of database
structures and should be used primarily with dev. version of databases. It doesn't represent
an alternative or competitive tool to specialized schema comparison software applications.
Model Size Limitations
l

Toad Data Modeler doesn't contain limitation based on fixed number of objects. You can
work with models of hundreds tables that contain few columns or on a model that contain
tens of tables with hundreds of column in each table. Number of other items in your
model (stored procedures, functions, sequences etc.) affects the performance as well. Other
factors include:
l

Type of tasks - you can model large database structure, generate complex
SQL scripts or detailed reports, but synchronization tasks might reach the
application limits sooner than generation of SQL scripts, for example.

l

Number of running processes on your machine.

l

Limited access to Microsoft Scripting Engine (standard part of operating system,
however in some situations access can be monitored by antiviral software etc.)

Related Topics
Model Update (page 451)
Open Object Explorer - Live Reverse Engineering (page 257)
Alter Scripts (page 443)
Convert Physical Models (PER)Toad Data Modeler allows you to convert:PER model into a
model of another database systemPER model to LER model and vice versaClick Model |
Conversion...to open Sync & Convert Wizard.See "Sync & Convert Wizard" (page 1) for more
information.See "Simple Model Conversion" (page 1) for more information. ScenarioConvert your
Oracle 10g model Videorental to MS SQL 2008. Use the Sync & Convert Wizard. Click on the
toolbar to open the Sync & Convert Wizard.On the Action page, select Convert Model to
Another Target Database System.On the Select Left Side page, select File (*.txp, *.txl). Click the
button on the right to find model Videorental in the Open dialog.On the Select Right Side page,
select a target database system MS SQL 2008.On the Settings page, select Comment Out
Database Specific Items.Tip: You can select whether you want to comment the database specific
items or not. If you converted your Oracle 10g model to Oracle 11g, you would clear this

Toad Data Modeler User Guide

438

Projects and Models

checkbox not to comment them.On the Select Object Types page, select Convert All.On the
Select Items page, you can select/deselect particular items of your model that you want or do not
want to convert. Leave the default selection to convert all items of model Videorental.On the
Review page, see the statistic information and define a model name for the converted model in
the New Model Name box - Videorental_Converted.Click Finish.The Sync & Convert Wizard
closes and the new model Videorental_Converted of MS SQL 2008 database opens in the
Application Window automatically. Note: Please read the User Guide for more examples on
model conversion. Related TopicsPER - PER Conversion Information (page 1)PER - LER
Conversion Information (page 1)Sync & Convert Wizard (page 1)Simple Model Conversion
(page 1)Conversion to Physical Model (page 1) (page 1)
Conversion to Physical Model (page 310)

Sync & Convert Wizard
The Sync & Convert Wizard allows you to:
l

Convert your models

l

Merge models

l

Generate Alter script

l

Compare models and generate Alter report

Basic Information
l

On the first page of the wizard, you select what action you want to perform. Then the
wizard guides you through other pages where you can select from the related options and
define particular settings.

l

The wizard allows you to work with the models from a file.

l

The Sync & Convert Wizard works in one direction.
It means that the changes can be transferred only from the left side to the right side
(from the Left model to the Right model) during model merge/alter script
generation.

l

For alter script generation, on the Settings page of the wizard you can define Options for
Default Selection of Items (CREATE, DROP, ALTER). The settings affect the default
selection of items on page Select Items, which helps you to generate the alter script faster
and more comfortably.

l

For alter script generation, there is an extra page Generator Settings.

l

The wizard has its own Log output.
On the Settings page, select the Log Progress to File checkbox to save the
messages that the wizard returns to a file.
Note: Location of this file is defined in Settings | Options | Paths | General tab |
Sync & Convert Log Path.

Toad Data Modeler User Guide

439

Projects and Models

l

The wizard has the Review page where you can find statistic data relating to the action
you perform.

l

For model merge, model compare and alter script generation, you have to select models of
the same database system.

To open the Sync & Convert Wizard
»

Click

on the toolbar (or select File | Synchronization | Sync & Convert Wizard...).

Page

Description

Action

Select the action you want to perform.

Select Left Side

Select the Left model. Left model is either the model
that you want to convert or it is the updated model.
Available Model - List of models currently open in
Toad Data Modeler.
File (*.txp, *.txl) - Click the button on the right to
open the file.

Select Right Side

Select the Right model. Right model is either the
target database system (model conversion) or it is the
model that you want to update.

Settings

The options on tab Settings differ according to the
selected action on first page of the Wizard.

Toad Data Modeler User Guide

440

Projects and Models

Page

Description
Log Progress to File - Select this checkbox to save
the messages that the Wizard returns to a file.
Notes:

Select Object Types

l

To define a default path for the log file, select
Settings | Options | Paths | General tab | Sync
and Convert Log Path.

l

For alter script generation, you can define
default selection of items on this page.

The options on tab Select Object Types differ
according to the selected action on first page of the
Wizard.
To modify selection of OTPs, click Detail Settings.
Note: Bulk selection/deselection of particular OTP is
possible (e.g. turn off Caption during Model
Update/Merge, Alter Script Generation).
Example: You need to turn off comparing of caption
in model with database during model update/merge.
Solution: Sync&Convert Wizard | Select Object
Types page | click Detailed Settings | right-click the
Model item | Unselect by Name | type Caption and
confirm OK. All Caption checkboxes for all model
objects will be deselected at one jump. (Caption is
turned off by default for alter script generation
(included in Only Physical Properties.)

Select Items

List of items of:
l

The model that you want to convert.

l

The models (Left model and Right model) that
you want to merge or compare or generate
alter script for.

On this page, you make selection of items (select or
clear the Action checkbox) that you want to apply according to the action you selected on first page of
the Wizard.
Note: The look and some options available on this
page differ according to the selected action. Details
can be found in appropriate topics - see the Related
Topics section.
Review

Statistic information about the model(s)
Note: The look and some options available on this
page differ according to the selected action. Details

Toad Data Modeler User Guide

441

Projects and Models

Page

Description
can be found in appropriate topics.

Note: Please read the User Guide for examples on actions you can perform in the Sync &
Convert Wizard.

Related Topics
Convert Model (page 431)
Model MergeMerge ModelsToad Data Modeler offers you two options to merge your
models:Simple Model Merge - allows you to merge physical models very quickly but without a
possibility to select particular items to merge. The target model will always be overwritten.
Model Merge in the Sync & Convert Wizard - allows you to see differences between two
models, select particular items to merge and merge the models either to already existing model or
into a new model.Example: You work with several models. Use Model Merge to compare the
models and merge them either one to the other (an existing model will be overwritten), or to
another model (a new model will be created). Both options are available at:File |
Synchronization |Sync & Convert.See Simple Model Merge for more information on this
option.See Sync & Convert Wizard for more information on the wizard.To merge your models in
the Sync & Convert WizardClick on the toolbar.On the Action page, select Merge Models.Go
through other pages of the wizard.Note: Please read the User Guide for more examples on model
merge. Sync & Convert Wizard, Select Items PageOn the Select Items page, you can select or
deselect items for the model merge – select or clear the particular checkbox in the Action
column.OptionDescriptionGo to Previous DifferenceGo to Next DifferenceExpand AllCollapse
AllRefresh Necessitated ItemsExplanation: Some objects are related together (e.g. entity and
domain, entity and relationship). Once you clear the Action box for particular entity, the related
items will be deselected too. Not to see them in the list, click Refresh Necessitated Items. The
list will be refreshed and the needless items will be removed.Opens the Wildcard Dialog where
you can define settings for bulk selection/deselection of the Action box of the items listed on
page Select Items.Display options for objects Display options for propertiesSource ModelThe
model selected on page Select Left Side of the wizard. It is the updated or modified
model.Destination ModelThe model selected on page Select Right Side of the wizard. It is the
model that you want to update.ActionSelect this checkbox to apply the difference in the
Destination Model (Left model).Clear this checkbox not to apply the difference in the
Destination Model (Left model).Default selection: All differences are selected to be
applied.Icons:This icon and the blue color say: "There is a difference."This icon and the green
color say: "This item exists in Left model and is missing in Right model."This icon and the red
color say: "This item is missing in Left model and exists in Right model."This icon and the blue
color say: "There is a difference." - There are different model names.The selected Action
checkbox says: "Apply the difference in the Destination Model." By default, all the Action
checkboxes are selected, which means: "Take all differences from the Left model (Source Model)
and apply them in the Right model (Destination Model)."In this example it means, e.g.:Model
name line: The Right model Videorental_Original (Destination Model) will be renamed to
Videorental_Modified after the model merge.SCOTT.T_MEDIUM entity: The entity will be

Toad Data Modeler User Guide

442

Projects and Models

added to the Right model.SCOTT.v_Customer_Has_Film view: The view will be deleted from
the Right model.Right-click an item to see the following options:OptionDescriptionCheck All
ChildrenSelects the Action checkbox of all children items.Uncheck All ChildrenClears the
Action checkbox of all children items.Check All Children to AddSelects the Action checkbox of
children items that exist in Left model and are missing in Right model ( items) to add them to
the Right model.Check All Children to RemoveSelects the Action checkbox of children items
that are missing in Left model and exist in Right model ( items) to remove them from the Right
model.Check All Modified ChildrenSelects the Action checkbox of children items where
properties differ (items) to apply the change in the Right model.Uncheck All Children to
AddClears the Action checkbox of children items that exist in Left model and are missing in
Right model ( items) not to apply this change in the Right model.Uncheck All Children to
RemoveClears the Action checkbox of children items that are missing in Left model and exist in
Right model ( items) not to apply this change in the Right model.Uncheck All Modified
ChildrenClears the Action checkbox of children items where properties differ (items) not to apply
this change in the Right model.Wildcard FilterOpens the Wildcard Dialog where you can define
settings for bulk selection/deselection of the Action box of the items listed on page Select
Items. Sync & Convert Wizard, Review PageOn the Review page, you can see the statistic
information. Here, you can also decide if you want to merge the changes to a new model or if
you want to update the existing model.To update the existing modelLeave the default settings.
To merge the models to a new modelSelect the Merge to New Model checkbox.To the Model
Name box, write the new model name.  Related TopicsSync & Convert WizardSimple Model
MergeModel UpdateSynchronization (page 1)
Alter Scripts (page 443)
Model CompareCompare Models, Alter ReportsToad Data Modeler allows you to view
differences between two models and for physical models you can generate alter reports in HTML,
RTF and PDF formats. Alter reports are not available in logical models.Example: You want to
compare Oracle 10g models Videorental_Original and Videorental_Modified and generate
HTML alter report for the differences.Note: Please read the User Guide for solution to this
example of alter report generation. You can compare your models and generate the alter report
via the Sync & Convert Wizard.To compare models and generate the alter report Click on the
toolbar.On the Action page, select Compare Models and Generate Alter Report.Go through other
pages of the wizard.See Sync & Convert Wizard for more information on the wizard. Sync &
Convert Wizard, Select Items PageOn the Select Items page, you can see differences between the
models. The differences will be generated in the alter report.OptionDescriptionGo to Previous
DifferenceGo to Next DifferenceExpand AllCollapse AllGenerate Alter ReportNote: Click this
icon to generate the report, or click the button Report at the bottom of the page.Display options
for objectsDisplay options for propertiesModel 1The model selected on page Select Left Side of
the wizard. It is the updated or modified model.Model 2The model selected on page Select Right
Side of the wizard. It is the older version of the model.Diff.Column showing the type of
difference: This icon and the blue color say: "There is a difference." This icon and the green
color say: "This item exists in Left model (Model 1) and is missing in Right model (Model 2)."
This icon and the red color say: "This item is missing in Left model (Model 1) and exists in
Right model (Model 2)." To generate the alter reportClick on page Select Items of the Sync &
Convert Wizard. The Report Wizard opens. You can close the Sync & Convert Wizard.Go
through the steps in the Report Wizard (same as during standard report generation).Note: The
Options page of the Report Wizard for the alter report is empty for now.Finally click Execute

Toad Data Modeler User Guide

443

Projects and Models

and Show to display the alter report. Related TopicsSync & Convert WizardHTML, RTF and
PDF Reports (page 1)

Alter Scripts
To synchronize changes that you made in the model with the database, generate alter scripts.
Alter scripts are generated in the Sync & Convert Wizard.
Example: You made some changes in your Oracle 10g model Videorental and resaved it as
model Videorental_Modified. (You added and also deleted some items, changed some properties
etc.). Now you want to generate complete alter script, including CREATE, DROP and ALTER
statements, for the model Videorental.
You don't have to work with two models. You can keep modifying a model (e.g. a previously
reversed model). Toad Data Modeler allows you to connect to your database directly without
prior complete reversing. So, you will simply open the Sync&Convert Wizard from your
modified model, go through the steps in the wizard, including connecting to your database.
To execute the generated alter script, you have to use a third party software (e.g. Toad for Oracle
for Oracle database). See "Toad for Oracle as Default Editor" (page 656) for more information.
Toad Data Modeler allows you to generate alter scripts for the following databases:
l

DB2 UDB 8, DB2 v9, DB2 v9.5, DB2 v9.7

l

Oracle 9i, Oracle 10g, Oracle 11g R1 and R2

l

MS SQL Azure

l

MS SQL Server 2005, MS SQL Server 2008

l

MySQL 5.0 and MySQL 5.1

l

PostgreSQL 8.1, 8.2, 8.3, 8.4

To generate alter script
1. Click

on the toolbar.

2. On page Action, select Generate Alter Script.
3. On page Select Left Side, select the updated model.

Toad Data Modeler User Guide

444

Projects and Models

4. On page Select Right Side, select the model model for which you want to
generate alter script. OR Connect directly to your database via the option
Reverse Engineering Alias.

5. On page Select Objects [RE], select tables you want to reverse (provided that
you connect to your database).

6. On page Settings, define particularly Options for Default Selection of Items.
The settings in this area affect the default selection of items on page Select Items of the
wizard, which helps you to generate the alter script faster and more comfortably. To

Toad Data Modeler User Guide
Projects and Models

generate a complete alter script for all differences (CREATE, DROP and ALTER
statements), select all the checkboxes (all of them are selected by default).
7. On page Select Object Types, you can influence what object and property
differences you want to compare. Click Detailed Settings to make manual
selection of particular items.

Note: Bulk selection/deselection of particular OTP is possible (e.g. turn off
Caption during Model Update/Merge, Alter Script Generation).
Example: You need to turn off comparing of caption in model with database
during model update/merge.
Solution: Sync&Convert Wizard | Select Object Types page | click Detailed
Settings | right-click the Model item | Unselect by Name | type Caption and
confirm OK. All Caption checkboxes for all model objects will be deselected at
one jump. (Caption is turned off by default for alter script generation (included in
Only Physical Properties.)

445

Toad Data Modeler User Guide
Projects and Models

8. On page Generator Settings, select from the following options:

Note: In previous versions, the settings defined in the DDL Script Generation
dialog | Detail Settings tab were also taken for the alter script generation
(quotations, schema prefix, primary key inside or outside statements). It was
recommended to set up the same DDL script generation settings for both models
that are being compared. Now it is not necessary. You can define these settings
directly in the Sync & Convert Wizard on the new page.
9. On the Select Items page, you can see the differences between the models.
Example:

446

Toad Data Modeler User Guide

447

Projects and Models

Option

Description
Go to Previous Difference
Go to Next Difference
Expand All
Collapse All
Refresh Necessitated Items
Explanation: Some objects are related together (e.g. entity and domain,
entity and relationship). Once you clear the Action box for particular
entity, the related items will be deselected too. Not to see them in the list,
click Refresh Necessitated Items. The list will be refreshed and the
needless items will be removed.
Runs the verification process.
The verification might return a warning
box at the bottom of the page.

. Details are available in the

Toad Data Modeler User Guide

448

Projects and Models

Option

Description
Display options for objects

Display options for properties

Opens the Wildcard Dialog where you can define settings for bulk
selection/deselection of the Action box of the items listed on page Select
Items.
Model
1

The model selected on page Select Left Side of the wizard. It is the
updated or modified model.

Model
2

The model selected on page Select Right Side of the wizard. It is the
model for which you want to generate the alter script.

Action

Select this checkbox to generate alter script for the difference.
Clear this checkbox not to generate alter script for the difference.
Default selection: Default selection of the Action checkboxes depend on
your settings on page Settings, in the Options for Default Selection of
Items area. If you select all the options in this area, the Action
checkboxes will be selected for all changes (CREATE, DROP and
ALTER) by default.

Icons:

This icon and the blue color say: "There is a difference."

This icon and the green color say: "This item exists in Left model and is missing in
Right model."

This icon and the red color say: "This item is missing in Left model and exists in Right model."

Toad Data Modeler User Guide

449

Projects and Models

All the Action checkboxes are selected in the example above, which means: "Generate alter
script for all the differences."
In this example it means, e.g.:
l

Added SCOTT.T_MEDIUM entity: CREATE statement.

l

Changed data type from Varchar2 to Date of Order Date attribute: ALTER statement.

l

Deleted view SCOTT.v_Customer_Has_Film: DROP statement.

Right-click an item to see the following options:

Option

Description

Check All Children

Selects the Action checkbox of all children items.

Uncheck All Children

Clears the Action checkbox of all children items.

Check All Children to
Add

Selects the Action checkbox of children items that exist in

Check All Children to
Remove

Selects the Action checkbox of children items that are
missing in Left model and exist in Right model (

Left model and are missing in Right model (
generate the CREATE statement.

items) to

items) to generate the DROP statement.
Check All Modified
Children

Selects the Action checkbox of children items where
properties differ ( items) to generate the ALTER
statement.

Uncheck All Children
to Add

Clears the Action checkbox of children items that exist in
Left model and are missing in Right model (
items) not
to generate alter script for this change.

Uncheck All Children
to Remove

Clears the Action checkbox of children items that are

Toad Data Modeler User Guide

450

Projects and Models

Option

Description
missing in Left model and exist in Right model (
items) not to generate alter script for this change.

Uncheck All Modified
Children

Clears the Action checkbox of children items where
properties differ ( items) not to generate alter script for
this change.

Wildcard Filter

Opens the Wildcard Dialog where you can define
settings for bulk selection/deselection of the Action box
of the items listed on page Select Items.

10. On page Review, see the statistic information and check out the output file with the
generated alter script. Click Finish.

Alter Script Generation - Temporary Tables
There is a possibility not to use temporary tables during alter script generation. Solution:
Oracle db
Select Settings | Options | Physical Model | Oracle | Alter Script Settings area for two new
checkboxes:
Use Temporary Tables to Preserve Data – It is selected by default, current behavior. If you
clear this checkbox, a sequence of commands DROP TABLE / CREATE TABLE will be
generated instead of temporary tables. (The exception are the changes in data types where
ALTER TABLE command is generated.)
Use Temporary Tables to Preserve Data on Data Type Change – It is selected by default,
current behavior. It is necessary to select also the Use Temporary Tables to Preserve Data
checkbox, otherwise the second checkbox will work as if it was unselected.
If you clear the Use Temporary Tables to Preserve Data on Data Type Change checkbox,
command ALTER TABLE will be generated for changes in data types instead of the temporary
tables (only during some changes in Virtual v OR11, command DROP/CREATE TABLE will
be executed.)
Other Database Platforms (DB2, MS SQL Azure, MS SQL Server, MySQL,
PostgreSQL):
Select Settings | Options | Physical Model | particular database | Alter Script Setting area for
new checkbox: Use Temporary Tables to Preserve Data – It is selected by default, current
behavior. If you clear this checkbox, a sequence of commands DROP TABLE / CREATE
TABLE will be generated instead of temporary tables.

Toad Data Modeler User Guide

451

Projects and Models

Note: For databases MS SQL Azure, MS SQL Server, PostgreSQL, the following stands: If you
clear the Use Temporary Tables to Preserve Data checkbox, temporary UDT/DictType will not
be generated either. (They had to be created in connection with temporary tables.)

Related Topics
Sync & Convert Wizard (page 438)
Synchronization (page 435)

Model Update
Toad Data Modeler allows you to update models to synchronize changes between your database
and your model.
Example: You loaded the database structure of your database to Toad Data Modeler (Reverse
Engineering). - Model A was created. Then you made some changes in your database and now
you want to update the Model A. For this purpose, you can use the Model Update feature.
Model Update includes operations such as connecting to database, comparison and model merge.
To update your model
1. Open the model that you want to update.
2. Select Model | Synchronize | Update Model... to open the Model Update Wizard
3. Select Connection from the list of stored connections.

Toad Data Modeler User Guide

452

Projects and Models

4. Click button Load Connection to load settings and type password to your
selected database connection

4. On the Tables page, select the tables that you want to load and click Execute.

5. Now it's time to define settings for the model merge.
On page Settings, select e.g. the Log Progress to File checkbox to save the messages that
the wizard returns to a file.

Toad Data Modeler User Guide

453

Projects and Models

6. On the Select Object Types page, select Compare All without Graphics. 

7. On the Select Items page, you can select or deselect the items for the model merge –
select or clear the particular checkbox in the Action column.
Leave the default selection, which means: "Take all differences from the Left
model (Source Model) and apply them in the Right model (Destination model)."
Example:

8. On the Review page, see the statistic information. Here, you can also decide if you want
to merge the changes to a new model or if you want to update the existing model.
You want to update the existing model.

Toad Data Modeler User Guide

454

Projects and Models

9. Click Finish.
10. The wizard closes and the updated model activates in the Application Window.

Related Topics
Create New Model from Database - Reverse Engineering (page 255)
Model MergeMerge ModelsToad Data Modeler offers you two options to merge your
models:Simple Model Merge - allows you to merge physical models very quickly but without a
possibility to select particular items to merge. The target model will always be overwritten.
Model Merge in the Sync & Convert Wizard - allows you to see differences between two
models, select particular items to merge and merge the models either to already existing model or
into a new model.Example: You work with several models. Use Model Merge to compare the
models and merge them either one to the other (an existing model will be overwritten), or to
another model (a new model will be created). Both options are available at:File |
Synchronization |Sync & Convert.See Simple Model Merge for more information on this
option.See Sync & Convert Wizard for more information on the wizard.To merge your models in
the Sync & Convert WizardClick on the toolbar.On the Action page, select Merge Models.Go
through other pages of the wizard.Note: Please read the User Guide for more examples on model
merge. Sync & Convert Wizard, Select Items PageOn the Select Items page, you can select or
deselect items for the model merge – select or clear the particular checkbox in the Action
column.OptionDescriptionGo to Previous DifferenceGo to Next DifferenceExpand AllCollapse
AllRefresh Necessitated ItemsExplanation: Some objects are related together (e.g. entity and
domain, entity and relationship). Once you clear the Action box for particular entity, the related
items will be deselected too. Not to see them in the list, click Refresh Necessitated Items. The
list will be refreshed and the needless items will be removed.Opens the Wildcard Dialog where
you can define settings for bulk selection/deselection of the Action box of the items listed on
page Select Items.Display options for objects Display options for propertiesSource ModelThe
model selected on page Select Left Side of the wizard. It is the updated or modified
model.Destination ModelThe model selected on page Select Right Side of the wizard. It is the
model that you want to update.ActionSelect this checkbox to apply the difference in the

Toad Data Modeler User Guide

455

Projects and Models

Destination Model (Left model).Clear this checkbox not to apply the difference in the
Destination Model (Left model).Default selection: All differences are selected to be
applied.Icons:This icon and the blue color say: "There is a difference."This icon and the green
color say: "This item exists in Left model and is missing in Right model."This icon and the red
color say: "This item is missing in Left model and exists in Right model."This icon and the blue
color say: "There is a difference." - There are different model names.The selected Action
checkbox says: "Apply the difference in the Destination Model." By default, all the Action
checkboxes are selected, which means: "Take all differences from the Left model (Source Model)
and apply them in the Right model (Destination Model)."In this example it means, e.g.:Model
name line: The Right model Videorental_Original (Destination Model) will be renamed to
Videorental_Modified after the model merge.SCOTT.T_MEDIUM entity: The entity will be
added to the Right model.SCOTT.v_Customer_Has_Film view: The view will be deleted from
the Right model.Right-click an item to see the following options:OptionDescriptionCheck All
ChildrenSelects the Action checkbox of all children items.Uncheck All ChildrenClears the
Action checkbox of all children items.Check All Children to AddSelects the Action checkbox of
children items that exist in Left model and are missing in Right model ( items) to add them to
the Right model.Check All Children to RemoveSelects the Action checkbox of children items
that are missing in Left model and exist in Right model ( items) to remove them from the Right
model.Check All Modified ChildrenSelects the Action checkbox of children items where
properties differ (items) to apply the change in the Right model.Uncheck All Children to
AddClears the Action checkbox of children items that exist in Left model and are missing in
Right model ( items) not to apply this change in the Right model.Uncheck All Children to
RemoveClears the Action checkbox of children items that are missing in Left model and exist in
Right model ( items) not to apply this change in the Right model.Uncheck All Modified
ChildrenClears the Action checkbox of children items where properties differ (items) not to apply
this change in the Right model.Wildcard FilterOpens the Wildcard Dialog where you can define
settings for bulk selection/deselection of the Action box of the items listed on page Select
Items. Sync & Convert Wizard, Review PageOn the Review page, you can see the statistic
information. Here, you can also decide if you want to merge the changes to a new model or if
you want to update the existing model.To update the existing modelLeave the default settings.
To merge the models to a new modelSelect the Merge to New Model checkbox.To the Model
Name box, write the new model name.  Related TopicsSync & Convert WizardSimple Model
MergeModel UpdateSynchronization (page 1)

Model Compare
Compare Models, Alter Reports
Toad Data Modeler allows you to view differences between two models and for physical models
you can generate alter reports in HTML, RTF and PDF formats. Alter reports are not available in
logical models.
Example: You want to compare Oracle 10g models Videorental_Original and Videorental_
Modified and generate HTML alter report for the differences.
Note: Please read the User Guide for solution to this example of alter report generation. 
You can compare your models and generate the alter report via the Sync & Convert Wizard.

Toad Data Modeler User Guide

456

Projects and Models

To compare models and generate the alter report
1. Click

on the toolbar.

2. On the Action page, select Compare Models and Generate Alter Report.
3. Go through other pages of the wizard.
See "Sync & Convert Wizard" (page 438) for more information on the wizard.

Sync & Convert Wizard, Select Items Page
On the Select Items page, you can see differences between the models. The differences will be
generated in the alter report.
Option

Description
Go to Previous Difference
Go to Next Difference
Expand All
Collapse All
Generate Alter Report
Note: Click this icon to generate the report, or click the button Report at
the bottom of the page.
Display options for objects

Display options for properties

Model
1

The model selected on page Select Left Side of the wizard. It is the
updated or modified model.

Model
2

The model selected on page Select Right Side of the wizard. It is the
older version of the model.

Diff.

Column showing the type of difference:
This icon and the blue color say: "There is a difference."

Toad Data Modeler User Guide

457

Projects and Models

Option

Description
This icon and the green color say: "This item exists in Left model
(Model 1) and is missing in Right model (Model 2)."
This icon and the red color say: "This item is missing in Left model
(Model 1) and exists in Right model (Model 2)."

To generate the alter report
1. Click
on page Select Items of the Sync & Convert Wizard.
The Report Wizard opens. You can close the Sync & Convert Wizard.
2. Go through the steps in the Report Wizard (same as during standard report generation).
Note: The Options page of the Report Wizard for the alter report is
empty for now.
3. Finally click Execute and Show to display the alter report.

Related Topics
Sync & Convert Wizard (page 438)
Reports (page 319)

Model Merge
Merge Models
Toad Data Modeler offers you two options to merge your models:
l

Simple Model Merge - allows you to merge physical models very quickly but without a
possibility to select particular items to merge. The target model will always be
overwritten.

l

Model Merge in the Sync & Convert Wizard - allows you to see differences between
two models, select particular items to merge and merge the models either to already
existing model or into a new model.
Example: You work with several models. Use Model Merge to compare the
models and merge them either one to the other (an existing model will be
overwritten), or to another model (a new model will be created).

Both options are available at:
»

File | Synchronization |Sync & Convert.

See "Simple Model Merge" (page 461) for more information

Toad Data Modeler User Guide

458

Projects and Models

See "Sync & Convert Wizard" (page 438) for more information
To merge your models in the Sync & Convert Wizard
1. Click

on the toolbar.

2. On the Action page, select Merge Models.
3. Go through other pages of the wizard.
Note: Please read the User Guide for more examples on model merge.

Sync & Convert Wizard, Select Items Page
On the Select Items page, you can select or deselect items for the model merge – select or clear
the particular checkbox in the Action column.
Option

Description
Go to Previous Difference
Go to Next Difference
Expand All
Collapse All
Refresh Necessitated Items
Explanation: Some objects are related together (e.g. entity and
domain, entity and relationship). Once you clear the Action box for
particular entity, the related items will be deselected too. Not to see
them in the list, click Refresh Necessitated Items. The list will be
refreshed and the needless items will be removed.
Opens the Wildcard Dialog where you can define settings for bulk
selection/deselection of the Action box of the items listed on page
Select Items.
Display options for objects

Toad Data Modeler User Guide

459

Projects and Models

Option

Description
Display options for properties

Source
Model

The model selected on page Select Left Side of the wizard. It is the
updated or modified model.

Destination
Model

The model selected on page Select Right Side of the wizard. It is the
model that you want to update.

Action

Select this checkbox to apply the difference in the Destination Model
(Left model).
Clear this checkbox not to apply the difference in the Destination
Model (Left model).
Default selection: All differences are selected to be applied.

Icons:

This icon and the blue color say: "There is a difference."

This icon and the green color say: "This item exists in Left model and is missing in
Right model."

This icon and the red color say: "This item is missing in Left model and exists in Right model."

This icon and the blue color say: "There is a difference." - There are different model names.
The selected Action checkbox says: "Apply the difference in the Destination Model."
By default, all the Action checkboxes are selected, which means: "Take all differences from the
Left model (Source Model) and apply them in the Right model (Destination Model)."
In this example it means, e.g.:
l

Model name line: The Right model Videorental_Original (Destination Model) will be
renamed to Videorental_Modified after the model merge.

Toad Data Modeler User Guide

460

Projects and Models

l

SCOTT.T_MEDIUM entity: The entity will be added to the Right model.

l

SCOTT.v_Customer_Has_Film view: The view will be deleted from the Right model.

Right-click an item to see the following options:

Option

Description

Check All Children

Selects the Action checkbox of all children items.

Uncheck All Children

Clears the Action checkbox of all children items.

Check All Children to
Add

Selects the Action checkbox of children items that exist in

Check All Children to
Remove

Selects the Action checkbox of children items that are
missing in Left model and exist in Right model (

Left model and are missing in Right model (
add them to the Right model.

items) to

items) to remove them from the Right model.
Check All Modified
Children

Selects the Action checkbox of children items where
properties differ ( items) to apply the change in the
Right model.

Uncheck All Children
to Add

Clears the Action checkbox of children items that exist in
Left model and are missing in Right model (
items) not
to apply this change in the Right model.

Uncheck All Children
to Remove

Clears the Action checkbox of children items that are
missing in Left model and exist in Right model (
items) not to apply this change in the Right model.

Uncheck All Modified
Children

Clears the Action checkbox of children items where
properties differ ( items) not to apply this change in the
Right model.

Toad Data Modeler User Guide

461

Projects and Models

Option

Description

Wildcard Filter

Opens the Wildcard Dialog where you can define
settings for bulk selection/deselection of the Action box
of the items listed on page Select Items.

Sync & Convert Wizard, Review Page
On the Review page, you can see the statistic information. Here, you can also decide if you want
to merge the changes to a new model or if you want to update the existing model.
To update the existing model
»

Leave the default settings.

To merge the models to a new model
1. Select the Merge to New Model checkbox.
2. To the Model Name box, write the new model name.

Related Topics
Sync & Convert Wizard (page 438)
Simple Model Merge (page 461)
Model Update (page 451)
Synchronization (page 435)
Simple Model Merge
This feature allows you to merge two physical models very quickly.
In comparison to the model merge in the Sync & Convert Wizard:
l

You cannot select particular items for the model merge (e.g. not to merge particular
entity). You can select only Object Types and Properties for the model merge.

l

The target model will always be overwritten.

To use the Simple Model Merge feature
1. Open both models that you want to merge.
2. Make the modified (updated) model active in the Application Window (source model).
3. Select File |Synchronization | Simple Model Merge....

Toad Data Modeler User Guide

462

Projects and Models

4. From the To Model box, select a model that you want to update (target model). - This
model will be overwritten.
5. See other options.
Option

Description

To
Model

Select a target model.

More>>

Click this button to see and modify Object
Types and Properties for the model merge.See
"Object Types and Properties - OTPs " (page
406) for more information.

Close
after
Merge

Closes the Merge dialog after the process is
finished.

Merge

Executes the process of model merge.

Close

Closes the Merge dialog.

6. Click Merge.

Related Topics
Model MergeMerge ModelsToad Data Modeler offers you two options to merge your
models:Simple Model Merge - allows you to merge physical models very quickly but without a
possibility to select particular items to merge. The target model will always be overwritten.
Model Merge in the Sync & Convert Wizard - allows you to see differences between two
models, select particular items to merge and merge the models either to already existing model or
into a new model.Example: You work with several models. Use Model Merge to compare the
models and merge them either one to the other (an existing model will be overwritten), or to
another model (a new model will be created). Both options are available at:File |
Synchronization |Sync & Convert.See "Simple Model Merge" (page 1) for more informationSee
"Sync & Convert Wizard" (page 1) for more informationTo merge your models in the Sync &
Convert WizardClick on the toolbar.On the Action page, select Merge Models.Go through other
pages of the wizard.Note: Please read the User Guide for more examples on model merge. Sync
& Convert Wizard, Select Items PageOn the Select Items page, you can select or deselect items
for the model merge – select or clear the particular checkbox in the Action
column.OptionDescriptionGo to Previous DifferenceGo to Next DifferenceExpand AllCollapse
AllRefresh Necessitated ItemsExplanation: Some objects are related together (e.g. entity and
domain, entity and relationship). Once you clear the Action box for particular entity, the related
items will be deselected too. Not to see them in the list, click Refresh Necessitated Items. The
list will be refreshed and the needless items will be removed.Opens the Wildcard Dialog where
you can define settings for bulk selection/deselection of the Action box of the items listed on
page Select Items.Display options for objects Display options for propertiesSource ModelThe

Toad Data Modeler User Guide

463

Projects and Models

model selected on page Select Left Side of the wizard. It is the updated or modified
model.Destination ModelThe model selected on page Select Right Side of the wizard. It is the
model that you want to update.ActionSelect this checkbox to apply the difference in the
Destination Model (Left model).Clear this checkbox not to apply the difference in the
Destination Model (Left model).Default selection: All differences are selected to be
applied.Icons:This icon and the blue color say: "There is a difference."This icon and the green
color say: "This item exists in Left model and is missing in Right model."This icon and the red
color say: "This item is missing in Left model and exists in Right model."This icon and the blue
color say: "There is a difference." - There are different model names.The selected Action
checkbox says: "Apply the difference in the Destination Model." By default, all the Action
checkboxes are selected, which means: "Take all differences from the Left model (Source Model)
and apply them in the Right model (Destination Model)."In this example it means, e.g.:Model
name line: The Right model Videorental_Original (Destination Model) will be renamed to
Videorental_Modified after the model merge.SCOTT.T_MEDIUM entity: The entity will be
added to the Right model.SCOTT.v_Customer_Has_Film view: The view will be deleted from
the Right model.Right-click an item to see the following options:OptionDescriptionCheck All
ChildrenSelects the Action checkbox of all children items.Uncheck All ChildrenClears the
Action checkbox of all children items.Check All Children to AddSelects the Action checkbox of
children items that exist in Left model and are missing in Right model ( items) to add them to
the Right model.Check All Children to RemoveSelects the Action checkbox of children items
that are missing in Left model and exist in Right model ( items) to remove them from the Right
model.Check All Modified ChildrenSelects the Action checkbox of children items where
properties differ (items) to apply the change in the Right model.Uncheck All Children to
AddClears the Action checkbox of children items that exist in Left model and are missing in
Right model ( items) not to apply this change in the Right model.Uncheck All Children to
RemoveClears the Action checkbox of children items that are missing in Left model and exist in
Right model ( items) not to apply this change in the Right model.Uncheck All Modified
ChildrenClears the Action checkbox of children items where properties differ (items) not to apply
this change in the Right model.Wildcard FilterOpens the Wildcard Dialog where you can define
settings for bulk selection/deselection of the Action box of the items listed on page Select
Items. Sync & Convert Wizard, Review PageOn the Review page, you can see the statistic
information. Here, you can also decide if you want to merge the changes to a new model or if
you want to update the existing model.To update the existing modelLeave the default settings.
To merge the models to a new modelSelect the Merge to New Model checkbox.To the Model
Name box, write the new model name.  Related TopicsSync & Convert Wizard (page 1)Simple
Model Merge (page 1)Model Update (page 1)Synchronization (page 1) (page 1)
Sync & Convert Wizard (page 438)
Simple Model Conversion (page 434)

Toad Data Modeler User Guide

464

Projects and Models

Options and Configuration
Options
To configure global settings for Toad Data Modeler and also settings for particular models
(Oracle etc.)
»

Select Settings| Options.

In the Options dialog, you can define:
l

Default options (e.g. options for models) - If you change default options, the changes
will be applied for new models,not in already existing models.

l

Other options (e.g. number of Undo/Redo steps, paths in Version Manager) - You can
change them at any time. The changes will be applied immediately for the currently
opened model.

There are two main sections in the Options dialog:
l

Application - here you can modify all basic settings of the application

l

Model - here you can modify settings for every new model you will create and for models
of particular database platform

Application
Expert Mode
Page

This page is available provided that you enabled the
Expert Mode option on page General.
This mode is for experts and advanced users of Toad
Data Modeler 3.x and turns on some options for
customization and scripting.
See Expert Mode for more information.

General Page

Set up options such as number of Undo/Redo steps,
instances of application, check for updates on startup,
icons theme (classic TDM or Toad for Oracle), enable
Expert Mode or Save Models as Formatted XML Files
options, select unit of length etc.
Always Use CTRL to Select Attributes—By default,
this checkbox is checked=>standard behavior.
If unchecked:
l

By clicking on the attribute it gets selected
and can be dragged right-away.

l

Entity can be dragged only by clicking on the

Toad Data Modeler User Guide
Projects and Models

table header or on the space bellow attributes.
More features available for both modes:

Graphics Page

l

By pressing F2 key, Attribute inplace editing
is activated in case the attribute is selected
(formerly entity name used to open for
editing).

l

If an attribute is selected and is clicked on and
held in place for certain time ("long click"), it
gets opened right in inplace editing.

Define default graphic settings - e.g. mouse scroll
speed, grid size, a size of a step for moving shapes on
the Workspace (Move Objects by (mm/10) (in tenths
of millimeters)), select or clear the checkboxes Visible
Page Boundaries and Visible Page Numbersetc.
See "Graphic Options on the Workspace" (page 41)
for more information.

Colors area

Define format that will be displayed for the selected
items in Designer (e.g. for selected attributes during
copy and paste operation between entities.)

Autolayout
area

The lower the coefficient is, the smaller the distance
between tables will be.

Dialog Boxes
Page

This tab is empty until you forbid a dialog by
selecting the 'Do not show next time' checkbox in the
dialog itself. - If you select this option, a new
checkbox on the particular operation will display
here - on the Dialog Boxes tab.
To enable the particular dialog/operation again, select
the appropriate checkbox here.
Example: If you click Do Not Display Next Time in
the Check Out dialog, the item will appear in the list
of Dialog Boxes.

Other examples:
Automatic Apply before Edit - If it's selected, you
can add e.g. new attributes to entities without the

465

Toad Data Modeler User Guide
Projects and Models

Apply confirmation and edit them directly.
Deletion of Explorer Items - If it's selected, the item
for which you select Delete Item in Model Explorer,
will be deleted from your model without further
confirmation.
Save Model - If it's selected, the model for which you
select Close Model will have to be saved.
Paths Page

On this page, you define paths to packages, models,
metamodels, the file with generated script, HTML and
RTF reports, styles, the Log file, the Sync and
Convert Log file and user selected OTPs.
Note: Path to Packages is a path to a location where
user packages are stored. In this location, My
Package.txg file MUST exist.
If you want to change the path to packages, you need
to make a copy of the My Package.txg file from the
default location to the new location.
Default location is:
C:\Documents and Settings\user name\My
Documents\Toad Data Modeler\Installation
name\Packages\{SOME GUID Number}.

Reverse
Engineering
Page

Here, you can define a path to a directory where
aliases created during reverse engineering will be
saved.
Save Passwords with Aliases - This option works
automatically for aliases that you will create. If it is
selected, the option Save Password in the RE
Wizard | Connections page (or in the Connections
dialog) will be selected by default.
Note: If you want to save password with your
existing aliases, you have to select the Save
Password checkbox manually for the particular alias
– either on the Connecting page or double-click the
selected alias on page Stored Aliases in the RE
Wizard. (In any case, the Save Passwords with
Aliases checkbox must be selected.)
Live Reverse Engineering section enables you to
enable/disable Check After Script option for Live RE
feature.
Search section allows you to enable/disable Auto
Hide Items feature to hide items as you type filter in
Reverse Engineering wizard, step Tables, and to set
delay.

466

Toad Data Modeler User Guide
Projects and Models

Reports Page

Define default file names for HTML and RTF reports
and select a preferred language for your reports.

Version
Manager Page

Version Manager default settings for a server and a
client are defined here. Set up paths for saving logs,
paths to directories where you save your projects, file
with servers, versions etc.
See "Version ManagerAbout Version ManagerVersion
Manager allows you to create projects, add models
(logical models, physical models) and other files (e.g.
text files, images etc.) to your projects, create versions
and revisions etc. Toad Data Modeler allows you to
create unlimited number of projects.To open Version
Manager Enable Expert Mode: select Settings |
Options | General | select the Expert Mode
checkbox.Click on the toolbar (or select Expert Mode
| Version Manager). Version Manager window is a
place from where you can access all files stored in
Version Manager. Tip: You can open several
instances of Version Manager, e.g. for each
project. What Is a Project?Project is a group of
models and other files that logically match together
although they are not of the same origin (physical
data model, document file, image etc.). Example:
You have created a project for Company "X". This
project contains various models (LER, PER models)
and some other files (text files, images etc). The
models are models of different databases and have a
different number of versions/revisions. Nevertheless,
all these models and files logically match together all of them relate to Company "X". As stated above,
projects can contain models as well as other files of
any type (e.g. any documentation to models, text
files, images, other programs...) Nevertheless, Toad
Data Modeler is not able to work directly with such
files. It can only call appropriate programs or allows
you to view them only (see the Show Version (only
to read) option). Related TopicsProjects and Files in
Version Manager" (page 1) for more information.

Editable
Forms Page

Here, you can find basic options for design mode and
particular options for Component Palette, Object
Inspector, and Form Explorer.
If you accidentally close the Component Palette ,
Object Inspector, Form Explorer or Alignment
palette, select appropriate checkboxes on tab Design
Mode in this dialog.

467

Toad Data Modeler User Guide
Projects and Models

Scripting Page

Select options for the Scripting Window.
See "Scripting Window" (page 541) for more
information.

Show
Windows
Automatically

Define default value that will be applied on the
Scripting Window toolbar.

Show Log

Define default value to display the Log area in the
Scripting Window.

Toad for
Oracle
Integration
Page

On this tab, you can set up default settings for Toad
for Oracle integration.

Version
Control
System Page

Version Control System settings are managed in this
tab. Choose if you want to use Subversion or not,
define path to Working Directory, SVN Client and
SVN Server.

Print settings
Page

In this tab, all setting options from Print and Print
Gradient dialogs can be found.

See "About Integration Options" (page 650) for more
information.

468

Toad Data Modeler User Guide
Projects and Models

Model
Set default format settings for new models - physical and logical or for new Workspaces.
Physical
Model Page

Define basic settings for physical models. Set up
default format for new PER models, select default
display mode, display level for entities, Word Wrap
option, define settings for DDL/SQL script generation
in the SQL Script area, right-angled mode for lines
etc.
See "Synchronization of NotNull and Mandatory
Parent" (page 127) for more information.
See "Format Objects" (page 62) for more information.

Page of
Particular
Database

On this page, you can define e.g. some options for
alter script generation, external editor for DDL script
generation of the particular database, set up a default
data type.
See "Alter Script Generation - Temporary Tables "
(page 450) for more information.

Define
External
Editor for
particular
database

The external editor only allows you to open the file
with generated DDL/SQL script, it doesn't allow you
to edit all SQL codes. Via this feature, you can view
the generated SQL code/alter script in the program
you prefer, and possibly execute the script from there.
How it works:
1. From the Select Code Editor Type box, select
Use Custom Editor.
2. In the External Editor for Generated Code
box, write a path to the program that should
run + parameter %CODE_ FILE_ NAME% that
shows a path to the generated file. Different
programs can have a different syntax.
Example:

469

Toad Data Modeler User Guide

470

Projects and Models

Tip: Define the External Editor just e.g. for Oracle
db. For Oracle 10g and 9i, select item Use the Setting
from Oracle. If you need to change the item in the
future, you will change it only once - for the Oracle
db item.
Set up Default
Data Type

Set up a default data type, including parameters, for
attributes of particular database. The selected data
type will be applied also for Dictionary Types and
Domains.
(The boxes are empty until you set a default data
type.)

Logical
Model Page

Define format settings for logical models. The options
are similar to those for PER model.

Related Topics
Designer and Workspace
To define different colors for attributes on your Workspace (page 86)

Default Values
Toad Data Modeler allows you to define and change default values of objects in your models.
Examples:
l

You want to define default values for referential integrity type in your model.

l

You want to define Not Null property for all new attributes that you create in
your model.

l

You want to define a name for your relationships in the following format: 'parent table child table'.
Tip: You can use application variables in default values. See "Application
Variables and Default Values" (page 376) for more information.

To open the Default Values dialog

Toad Data Modeler User Guide
Projects and Models

»

Select Settings | Default Values...
or
Open the Properties dialog of particular object (e.g. Relationship Properties form) |
right-click the form and select Default Values for Class.
Note: The second option is available only in Expert Mode.

To define a default value e.g. for relationships in your Oracle 10g model
1. Open your Oracle 10g model.
2. Select Settings | Default Values.
3. Select the Relationships item in the list.
4. Select the default value you want to modify.
5. Press F2 in the Default Value column.
6. Define the value and click anywhere else in the dialog.
7. Confirm OK.
8. Restart Toad Data Modeler.
Note: When you change the default values, you make modifications in package
(by default in My Package.txg file). So, to apply the changes, you need to save
the package.
9. Create a new relationship. - All newly created relationships will have the new
default value.

471

Toad Data Modeler User Guide

472

Projects and Models

To restore the original default values
1. Open the Default Valuesdialog.
2. Select the default value that you want to change back to original. (For multiple selection
use CTRL or SHIFT.)
3. Click Delete to restore the original default values.
4. Confirm OK.
5. Restart Toad Data Modeler.

Default Values Dialog
See the dialog for the Entities item and after the Show Details button has been clicked.

Option

Description

Model Objects

List of objects for which you can define or modify
default values.

Class Context

Level on which you want to apply the default values.
Example: PEREntityOR10 (entities in Oracle 10g
models only), PEREntityOR (entities in all Oracle
models), PEREntity (entities in physical model of any
database.)

Toad Data Modeler User Guide

473

Projects and Models

Option

Description

Name

Name of default value

Default Value

Values of particular default values. Press F2 to change
the selected default value.

Source

A place where changed or newly modified default
values are saved. By default they are saved to My
Package.txg file.

Status

- Default values stored in Metamodel.
- Default values defined or modified by user,
saved in My Package.
- Default values defined or modified by user,
saved in add-on package.

Ancestor
Source

Add-on Package - A place where some default values
are stored. Such default values can be modified,
however the changes can be saved only to My
Package.
Metamodel - A place where some default values are
stored. Such default values can be modified, however
the changes can be saved only to Metamodel.

Related Topics
Features (page 374)

Templates
About Templates
Toad Data Modeler allows you to:
l

Use pre-defined templates for properties that contain SQL code in your model (SQL,
Before Script, After Script etc.).

l

Create your own user templates for these properties.

l

Set up a default template for each property.

l

Import Toad for Oracle templates.

Example: You have created an entity trigger. Edit it and see the SQL tab in the Trigger
Properties dialog. The SQL code has been pre-defined = particular default template has been

Toad Data Modeler User Guide

474

Projects and Models

used (according to the database). You don’t have to write the code manually for every new
created trigger.

To select another than default template in object Properties dialog
»

Press CTRL+A to highlight all text in the text box and select another template from the
Templates box.
Note: To replace one template with another, all text should be selected.
Otherwise, the new template selected from the Templates box will be inserted
to the position of cursor in the box. This behavior allows you to put together
partial templates.

Option

Description

Templates

Shows all active templates for this object.
Inserts the selected template.
Opens the Template Editor.

All templates are available in Template Editor (page 475).

Toad Data Modeler User Guide

475

Projects and Models

Note: Templates for Properties with SQL Code - To find out for which properties you
can create the templates, see the Reference Guide and search the Supports Templates
attribute.

Related Topics
Template Editor (page 475)
Toad for Oracle TemplatesToad Data Modeler allows you to import the templates you created in
Toad for Oracle and refresh them at any time you need.We do not recommend to modify these
templates in Toad Data Modeler as export of the templates to Toad for Oracle is not
possible.Toad Data Modeler imports Toad for Oracle templates of the following objects:Stored
ProceduresFunctionsEntity TriggersPackages (object in Oracle)To import Toad for Oracle
template to Toad Data ModelerOpen Template Editor - Select Settings | Template Editor.Click .
The following dialog displays:Confirm OK and take notice of new templates in Template Editor
(e.g. "Default" templates). Note: The Toad for Oracle templates are stored in TOAD.txg file at:
C:\Documents and Settings\user name\My Documents\Toad Data Modeler\Installation
name\Packages\{GUI}To refresh your existing Toad for Oracle templates in Toad Data
ModelerClick . Toad for Oracle Auto Replacement WordsToad Data Modeler allows you to use
Application Variables in your templates. See….Toad for Oracle templates can have Auto
Replacement Words.During import of Toad for Oracle templates, the Toad for Oracle Auto
Replacement Words are replaced by Toad Data Modeler Application Variables. See how:Toad
for Oracle Auto Replacement WordToad Data Modeler Application
Variable%YourObjectName%<%FullName%>%Date%<%Date%>%SysDate%<%Date%>%Date
Time%<%DateTime%>%Time%<%Time%>%TableName%<%TableFullName%>%UserName%'
<%Author%>Note: Not all Toad for Oracle Auto Replacement Words are supported.  (page 1)
Template Editor
To open Template Editor
»

Select Settings | Templates....

To display templates for particular database or database version
1. From the Model Type box, select the database or particular database version.
2. Click Load Templates.
Note: This option is available only if packages with the templates for selected
database haven’t been loaded so far.

Toad Data Modeler User Guide
Projects and Models

Option

Description

Commit

Confirms changes made in the Template Editor
and saves them to particular packages.
Note: Packages are not saved to your hard disk.

Commit and Save

Confirms changes made in the Template Editor
and saves them to particular packages (.txg
files). The packages are saved to your hard
disk.

Rollback

Cancels changes made in Template Editor.

Import Toad for
Oracle Templates

Imports templates from Toad for Oracle to the
Toad Data Modeler Template Editor.
Note: This option is available only if you have
Toad for Oracle installed on your computer.

Model Type

Select a database or particular database version
for which you want to display the templates.
Tip: Feel free to open Templates Editor for
different database platforms or versions, dock
the windows, compare the templates.

476

Toad Data Modeler User Guide

477

Projects and Models

Option

Description
Creates a new template.
Deletes the selected template. Click Commit to
confirm the deletion.
Opens the Template Properties dialog.

Object Category

List of objects (entities, attributes, triggers,
check constraints, views, procedures etc.) with
list of available SQL properties (SQL, Before
Script , After Script etc.).

Parent

Information on parent object

Template Name

Specify any name for your template to
distinguish it from others.

Default

Select this checkbox to set the template as
default. The template will be pre-defined in the
object Properties dialog.

Active

Select this checkbox to display the template in
the Templates box in the object Properties
dialog.

Template

Provides a quick view on the body of the SQL
code.

Template body for
template

Write the SQL code to this window.
Note: Remember to save the changes Commit
or Commit and Save.

Available Pre-defined Templates
There are two pre-defined templates – Body and Complete. Both relate to the Generate SQL
Only checkbox on tab General of object Properties dialog.
l

Body – The Generate SQL Only checkbox is deselected.
Example of default code for trigger:
BEGIN
/*trigger_body*/

Toad Data Modeler User Guide

478

Projects and Models

END
l

Complete – The Generate SQL Only checkbox is selected. (It means that settings on tab
General are ignored in final SQL code.)
Example of default code for trigger:
CREATE OR REPLACE TRIGGER <%<%FullName%>%>
AFTER /*BEFORE*/
INSERT /*UPDATE | DELETE*/
ON <%<%TableFullName%>%>
BEGIN
/*trigger_body*/
END

To set up this property for your user templates, see the Template Properties dialog, General tab
and select or clear the Generate SQL Only checkbox.
Where Templates Are Stored
All pre-defined templates are saved in the Templates.txg file that is copied among user packages
during first start-up of Toad Data Modeler.
All user templates are by default saved to My Package.txg.
Both files are stored among user packages at (default location):
C:\Documents and Settings\user name\My Documents\Toad Data Modeler\Installation
name\Packages\{GUI}
Why are pre-defined templates stored in another package? - Once our team brings new predefined templates, you will be able to replace the old pre-defined templates with the new ones
(Templates.txg). Your user templates will stay preserved in your My Package.txg.
We do NOT recommend to modify the pre-defined templates. If you do so, please remember
to save the template to My Package.txg (see the Template Properties dialog, General tab,
Package area.)

Related Topics
Manage Templates (page 479)
Toad for Oracle TemplatesToad Data Modeler allows you to import the templates you created in
Toad for Oracle and refresh them at any time you need.We do not recommend to modify these
templates in Toad Data Modeler as export of the templates to Toad for Oracle is not

Toad Data Modeler User Guide

479

Projects and Models

possible.Toad Data Modeler imports Toad for Oracle templates of the following objects:Stored
ProceduresFunctionsEntity TriggersPackages (object in Oracle)To import Toad for Oracle
template to Toad Data ModelerOpen Template Editor - Select Settings | Template Editor.Click .
The following dialog displays:Confirm OK and take notice of new templates in Template Editor
(e.g. "Default" templates). Note: The Toad for Oracle templates are stored in TOAD.txg file at:
C:\Documents and Settings\user name\My Documents\Toad Data Modeler\Installation
name\Packages\{GUI}To refresh your existing Toad for Oracle templates in Toad Data
ModelerClick . Toad for Oracle Auto Replacement WordsToad Data Modeler allows you to use
Application Variables in your templates. See….Toad for Oracle templates can have Auto
Replacement Words.During import of Toad for Oracle templates, the Toad for Oracle Auto
Replacement Words are replaced by Toad Data Modeler Application Variables. See how:Toad
for Oracle Auto Replacement WordToad Data Modeler Application
Variable%YourObjectName%<%FullName%>%Date%<%Date%>%SysDate%<%Date%>%Date
Time%<%DateTime%>%Time%<%Time%>%TableName%<%TableFullName%>%UserName%'
<%Author%>Note: Not all Toad for Oracle Auto Replacement Words are supported.  (page 1)
Manage Templates
To create a user template
1. In Template Editor, select Object Category (e.g. Triggers).
2. Click

and write the code in the Template body for template window.

Tip: Feel free to use application variables in your templates. Reference link.
Note: To change the template name, click the Template Name column, press F2,
write the new name and press Enter.
3. Confirm the changes Commit or Commit and Save.
To change properties of a user template (e.g. location, visibility etc.)
1. Select a template.
2. Click

to open the Template Properties dialog.

3. Check properties of the template.

Option

Description

General Tab
Name

Write a name of your template.

Property Selection

Select for which database, object type and
property the template should be used.

Active Template

Select this checkbox to display the template

Toad Data Modeler User Guide

480

Projects and Models

Option

Description
in the Templates box in the object
Properties dialog.

Default Template

Select this checkbox to set this template as
default in particular object Properties
dialog.

Generate SQL
Only

Select this checkbox to set the property
Generate SQL Only enabled in the object
Properties dialog.
See "Available Pre-defined Templates" (page
477) for more information.

Package

Select a package where you want to save
the template. By default, user packages are
saved to My Package.txg.
See "Where Templates Are Stored" (page
478) for more information.

Lock Package

Sets the ReadOnly property of the .txg file
on the disk.

Visibility Tab

Select databases and database versions for
which the template should be valid and
available.

4. Confirm OK. 
5. Confirm Commit and Save.
To set a template as Default
1. Select a template in Template Editor.
2. Select the Default checkbox for the template.
3. Confirm Commit and Save.
To disable a template
(not to display it in the combo-box in the object Properties dialog)
1. In Template Editor, find the template that you want to disable and clear the
Active checkbox.
2. Confirm Commit and Save.

Toad Data Modeler User Guide

481

Projects and Models

To delete a template
1. In Template Editor, select the template that you want to delete.
2. Click

.

3. Confirm Commit and Save. Now it is not possible to edit the template.
Note: After you reopen the Template Editor, the deleted item will be removed.
The template has been deleted from the .txg package.

Related Topics
Template Editor (page 475)
Toad for Oracle Templates
Toad Data Modeler allows you to import the templates you created in Toad for Oracle and
refresh them at any time you need.
We do not recommend to modify these templates in Toad Data Modeler as export of the
templates to Toad for Oracle is not possible.
Toad Data Modeler imports Toad for Oracle templates of the following objects:
l

Stored Procedures

l

Functions

l

Entity Triggers

l

Packages (object in Oracle)

To import Toad for Oracle template to Toad Data Modeler
1. Open Template Editor - Select Settings | Template Editor.
2. Click

. The following dialog displays:

3. Confirm OK and take notice of new templates in Template Editor (e.g. "Default"
templates). 
Note: The Toad for Oracle templates are stored in TOAD.txg file at:
C:\Documents and Settings\user name\My Documents\Toad Data
Modeler\Installation name\Packages\{GUI}

Toad Data Modeler User Guide

482

Projects and Models

To refresh your existing Toad for Oracle templates in Toad Data Modeler
1. Click

.

Toad for Oracle Auto Replacement Words
Toad Data Modeler allows you to use Application Variables in your templates. See….
Toad for Oracle templates can have Auto Replacement Words.
During import of Toad for Oracle templates, the Toad for Oracle Auto Replacement Words are
replaced by Toad Data Modeler Application Variables. See how:
Toad for Oracle
Auto Replacement
Word

Toad Data Modeler Application Variable

%YourObjectName%

<%FullName%>

%Date%

<%Date%>

%SysDate%

<%Date%>

%DateTime%

<%DateTime%>

%Time%

<%Time%>

%TableName%

<%TableFullName%>

%UserName%'

<%Author%>

Toad Data Modeler User Guide

483

Projects and Models

Note: Not all Toad for Oracle Auto Replacement Words are supported.

Dictionaries
Dictionaries tool is available from the Settings | Dictionaries... menu and allows you to add and
translate new terms in your current dictionary from other dictionaries, import web-based
dictionaries and export dictionaries to the web (in CSV file format).

File Extensions
Toad Data Modeler works with the following files:
File

Description

*.TXP

Physical data models in XML
format

*.TXL

Logical data models in XML
format

*.TXM

Metamodels in XML format

*.DM2

Toad Data Modeler 2.x models

Toad Data Modeler User Guide
Projects and Models

File

Description

*.DMX

Toad Data Modeler 2.x models in
XML format

*.TXG

Packages

*.TXD

Default Config files

*.TXC

Config files

*.TXE

File with saved environment
configuration

*.TXS

Style definition files for HTML
reports

*.XSLT

File for XSL transformation

*.XSD

File describing structure of XML
file

*.TXA

File with Aliases

*.TXV

File with versions and revisions of
the Version Manager

*.TXN

Exceptions

*.TXI

Export/Import of Dictionary

*.TXO

OTPs settings

*.CSV

File for import/export of glossaries
to naming conventions

*.TXN

File with defined naming
convention rules

Note: Meaning of the extensions:
“T” - Toad Data Modeler
“X” - XML format
'last letter' is intuitive, e.g. “P” for Physical
model, “V” for Version Manager etc.

*.TXP Files
Physical models created in Toad Data Modeler have *.TXP extension. These files are in
XML format.

484

Toad Data Modeler User Guide

485

Projects and Models

*.TXL Files
Logical models created in Toad Data Modeler have *.TXL extension. These files are in
XML format.
By default, the .TXP and .TXL files are saved to a path defined in the Settings menu | Options |
Application | Paths | Advanced tab | Paths to Models.

*.TXM Files
Metamodels in XML format.
System metamodels are saved together with the application installation package. Possible path is:
C:\Program Files\Quest Software\Toad Data Modeler 3\Packages\System\MetaModels.
Path to user's metamodels can be set in the Settings menu | Options | Application | Paths | Paths
to Metamodels.

*.DM2 Files
Models created in Toad Data Modeler 2.x product.

*.DMX Files
Models created in Toad Data Modeler 2.x product (*.DM2) that were exported to XML format.

*.TXG Files
Packages where definition of database or its part, scripts, forms, data types etc. are saved. It's an
XML format.
System packages are saved together with the application installation package. Possible path is:
C:\Program Files\Quest Software\Toad Data Modeler 3\Packages\System.
User packages are saved in user's Documents and Settings directory, e.g.:
C:\Documents and Settings\user name\My Documents\Toad Data Modeler\Installation
Name\Packages\{SOME GUID Number}.

*.TXD Files
Default config files that are saved together with the application installation package, e.g.:
C:\Program Files\Quest Software\Toad Data Modeler 3\Configs.

Toad Data Modeler User Guide

486

Projects and Models

*.TXC Files
Config files that contain settings of Toad Data Modeler. The settings are accessible in the
Settings menu | Options.
.TXC files are modified .TXD files. If .TCX file doesn't exist, it will be created in user's
Documents and Settings directory automatically after running the application. Settings of .TXD
file will be copied to the new .TXC file then.

*.TXE File
Changed environment of Toad Data Modeler will be saved to this file after the
application is closed.
This file is saved in user's Documents and Settings directory.

*.TXS Files
Files with Style definitions for HTML reports.
CSS styles are saved in user's Documents and Settings directory.

*.XSLT Files
Templates for XSL transformation. Default path: C:\Program Files\Quest Software\Toad Data
Modeler 3\XSL

*.XSD Files
XSD file describes structure of XML file - of your physical model created in Toad Data Modeler
(TXP file). XSD shows how the TXP file looks like, how it is structured etc.
By default, the XSD file is generated to:
C:\Documents and Settings\user\My Documents\Toad Data Modeler\Reports

*.TXA Files
Files where aliases created during reverse engineering are saved. They are saved in user's
Documents and Settings directory.
The path to aliases can be set in the Settings menu | Options | Application | Reverse
Engineering | Paths to Aliases.

Toad Data Modeler User Guide

487

Projects and Models

*.TXV Files
Local files created after the Check Out operation in Version Manager. These files are contained
in projects saved in Version Manager. They are saved in user's Documents and Settings directory.
The paths can be set in the Settings menu | Options | Application | Version Manager.

*.TXN Files
Files that contain exceptions for data type conversion between databases.

*.TXI Files
Files where dictionary items (User Data Types, Dictionary Types and Domains) are saved
during export/import between models. You can save the .TXI file where you want, no default
path is defined.

*. TXO Files
Files where selected OTPs settings are saved.
1. Default (System) Selected OTPs are stored by default at:
C:\Program Files\Quest Software\Toad Data Modeler\Selected OTPs
2. User Selected OTPs are stored by default at:
C:\Documents and Settings\user\My Documents\Toad Data Modeler\Installation
Name\Selected OTPs

*.CSV Files
Import/export of glossaries (*.CSV files) also from/to other tools is possible. See the Naming
Convention Properties dialog | Glossary tab | Import button. You can find some CSV files with
diacritical marks at: C:\Program Files\Quest Software\Toad Data Modeler 3\Naming
Conventions\CSV.

*.TXN Files
Every defined naming convention is stored in external .TXN file stored by default in user
Documents folder, directory Toad Data Modeler\ Installation name\Naming Conventions.
Notes:

Toad Data Modeler User Guide

488

Projects and Models

1. Generally, it stands that system files are saved together with the application installation
package. (E.g.: C:\Program Files\Quest Software\Toad Data Modeler 3).
Files modified by a user are saved in the user's Documents and Settings directory.
(E.g.: C:\Documents and Settings\user name\My Documents\Toad Data Modeler,
or C:\Documents and Settings\user name\Application Data\Quest Software\Toad
Data Modeler.
2. The Documents and Settings directory is empty until you run Toad Data Modeler.
Then, all appropriate files will be copied to this directory from the application
installation package.
All changes you make for the files (e.g. changes in the application layout, new
aliases, modified styles in reports, new default path to generated SQL/DDL code,
modified My Package.txg file etc.) will be saved here and will be preserved when
you update the application.
If you need to restore the original default settings, you can simply delete
appropriate file in the Documents and Settings directory. When you run Toad Data
Modeler then, appropriate original default file from C:\Program Files\Quest
Software\Toad Data Modeler 3 will be copied to the Documents and Settings
directory again.

Version Control
Subversion
Getting Started - Subversion
Toad Data Modeleroffers you integration with third party version control systems. Version 5.0
supports Apache™ Subversion®.
Note: If you are familiar with Apache Subversion, you can skip this topic and navigate to
Application Settings topic.

To configure Apache Subversion on your machine
1. Download your preferred installation package. In this User Guide the preferred package is
VisualSVN, because the package contains Server, Management Console and svn.exe.

Toad Data Modeler User Guide
Projects and Models

2. Install both VisualSVN Server and Management Console.

489

Toad Data Modeler User Guide

490

Projects and Models

3. Define path to your SVN Server location, specify folder for your repository and
choose authentication method.

4. After installation run the Visual Server SVN Manager and create new user.

Toad Data Modeler User Guide
Projects and Models

5. Then create new repository

491

Toad Data Modeler User Guide

492

Projects and Models

6. Edit properties of your repositories and add setup permissions for your newly created user.

Next step: configure Toad Data Modeler application settings.

Toad Data Modeler User Guide

493

Projects and Models

Application settings - Version Control System
To configure settings for Version Control System in Toad Data Modeler
1. Click Settings | Options and select section Version Control System.
2. Select Subversion from the Type combo box and specify user name, password and also
Working Directory.

3. On tab Subversion, define path to folder with svn.exe file.

If you wish to save some time, make your Visual Server SVN Manager active, select your
repository, right click on it and choose Copy URL to Clipboard.

Toad Data Modeler User Guide

494

Projects and Models

Then paste content of your clipboard to the Server Path field.

4. If you wish to use Working folder for all your projects, select section Paths and define
Path to Projects to the same folder as you specified in field Working Directory.

Toad Data Modeler User Guide

495

Projects and Models

Project Settings
1. Before you create new project (with Version Control System) in Toad Data Modeler, run
Visual Server SVN Manager and add new folder to your repository.

Toad Data Modeler User Guide

496

Projects and Models

In this example, new folder E-commerce will be created.

2. Now make Toad Data Modeler active an click New | Project.
3. If you wish to manually define folders, choose Empty Project with Version Control
System item. (Toad Data Modeler project has predefined structure. See topic Create new
project for more information.)

Toad Data Modeler User Guide
Projects and Models

4. Define Project settings and if you wish to keep configuration simple, define path to
Location and Working Directory to the same folder.

497

Toad Data Modeler User Guide

498

Projects and Models

5. In last step you have to specify path to folder where svn.exe file is available and Server
Path. To save time, select your folder in Visual SVN Server Manager, right click on it
and choose Copy URL to Clipboard.

6. Then paste the path to Server Path field in Toad Data modeler Project Wizard.

Toad Data Modeler User Guide

499

Projects and Models

7. Important: Now you have to right click your created project in Application View and
choose Subversion | Check Out. This step is required!

Toad Data Modeler User Guide

500

Projects and Models

Subversion Actions
You can run Subversion actions from Application View.
Adding new folder
To add new folder
Right click your project name and choose New Folder...
Create new folder and then right click the folder and choose Subversion | Add.
To commit changes right click the folder again and choose Subversion | Commit.
Adding new model
To add new model to project
Right click project name or folder name and select New Model...

After creation right click the model name and select Subversion | Add. Confirm the addition by
selecting Subversion | Commit.
Working with other files
You can add also *.doc, *.xls and other file formats to your projects (check them out from
subversion etc.)
Toad Data Modeler allows you to open them from Application View.
To open existing file
Right click the file name in Application View and select Open File.

Toad Data Modeler User Guide

501

Projects and Models

Sample user defined structure of custom project with Version
Control System.

Legend

Direct comparison
If you wish to compare two models stored in Subversion, check them out one by one and make a
copy of one of them. Direct comparison belongs among planned features.

Toad Data Modeler User Guide

502

Projects and Models

Version Manager
About Version Manager
Version Manager allows you to create projects, add models (logical models, physical models)
and other files (e.g. text files, images etc.) to your projects, create versions and revisions etc.
Toad Data Modeler allows you to create unlimited number of projects.
To open Version Manager
1. Enable Expert Mode: select Settings | Options | General | select the Expert
Mode checkbox.
2. Click

on the toolbar (or select Expert Mode | Version Manager).

Version Manager window is a place from where you can access all files stored in
Version Manager.
Tip: You can open several instances of Version Manager, e.g. for each project.

What Is a Project?
Project is a group of models and other files that logically match together although they are not of
the same origin (physical data model, document file, image etc.).
Example: You have created a project for Company "X". This project contains various models
(LER, PER models) and some other files (text files, images etc). The models are models of
different databases and have a different number of versions/revisions. Nevertheless, all these
models and files logically match together - all of them relate to Company "X".
As stated above, projects can contain models as well as other files of any type (e.g. any
documentation to models, text files, images, other programs...) Nevertheless, Toad Data
Modeler is not able to work directly with such files. It can only call appropriate programs or
allows you to view them only (see the Show Version (only to read) option).

Related Topics
Projects and Files in Version ManagerThere are several ways how to create a project and add
files to it:Create a new project from scratch (plus possibility to add several files to the project at
one jump. - It is recommended when you store all files that you want to add to the new project
in one directory.)Create a new project while adding an ER Diagram to the project. - It is
recommended when you want to add a single Toad Data Modeler model to a new or already
existing project.Add a single file to already existing project additionally (no matter if it is a
model, text document, screenshot etc.).Summary - Add a model and file to already existing
project. A. Create a New Project from ScratchClick on the toolbar.Right-click the Local Server
item and select Add Project.Define properties of the project (see the following details). General

Toad Data Modeler User Guide

503

Projects and Models

TabDescriptionNameDefine a project name. The project name has to carry out conditions for file
names set in Windows, e.g. question mark "?" cannot be contained. The project name will
become a directory name on a disk. See the path where it will be created in the Settings menu |
Options | Version Manager. The default path can be:C:\Documents and Settings\user\Application
Data\Quest Software\Toad Data Modeler\Installation
Name\VersionManager\Server\Project\Project_Name.All files created in Version Manager will be
saved here until you change the path. Note: Information on versions (and their relations to other
versions and revisions) are saved by default to another file. Possible path is: C:\Documents and
Settings\userName\Application Data\Quest Software\Toad Data Modeler\Installation
Name\VersionManager\Server\projects.xmlAgain, you can change the path in the Settings
menu.Load Files in DirectoryClear (or not to select) this option to create a new project and let it
be empty. Select this option to enable the Directory box. Click the icon on the right to define a
path to a directory with files that you want to add to the project. All files stored in the directory
will be added to the project automatically. Sub-directories will be ignored. Description
TabNotes on the project should be written on this tab. If you want to add a group of files to this
project, follow the next steps 5 and 6.You already need to have all the files stored in one
directory.Select Load Files in Directory and click the small icon on the right. Find a directory
where files that you want to add to the project are stored.Confirm OK to load all files stored in
the directory to the project. B. Create a New Project + Add an ER Diagram to the ProjectCreate a
new model or open an existing one.Click on the toolbar (or Expert Mode | Version Manager |
Add to Version Manager) to open the New Version Location dialog.If no project exists on your
local server, click Add Project . (And follow step 4.)If the project where you want to add the
model exists on your local server, simply select it and click OK to add the model to the
project.The New Project dialog opens. Define a name and description of your project.Press OK to
confirm and turn back to the New Version Location dialog.Select the new project and confirm
OK to add the model to the project.The Check Outmessage displays and you are prompted to
define a path where your file should be checked outConfirm OK. The file doesn't exist and
therefore will be created.Click Yes. See the Version Manager now.  C. Add a Single File to
Existing ProjectClick on the toolbar to open Version Manager. Right-click the selected project
and click Add File to display a File browser.From the Files of Type box, select the appropriate
type, find the file and confirm Open. D. Summary - Add a Model and File to Existing
ProjectModel: Open the model and simply click on the toolbar. Select a project and confirm OK.
(See B.)Model or any other file: In Version Manager, right-click the selected project and click
Add File, find the file and confirm Open. (See C.) Related TopicsVersion Manager Toolbar and
Options (page 1)
Projects and Files in Version Manager
There are several ways how to create a project and add files to it:
A. Create a new project from scratch (plus possibility to add several files to the project at
one jump. - It is recommended when you store all files that you want to add to the new
project in one directory.)
B. Create a new project while adding an ER Diagram to the project. - It is recommended
when you want to add a single Toad Data Modeler model to a new or already
existing project.

Toad Data Modeler User Guide

504

Projects and Models

C. Add a single file to already existing project additionally (no matter if it is a model, text
document, screenshot etc.).
D. Summary - Add a model and file to already existing project.

A. Create a New Project from Scratch
1. Click

on the toolbar.

2. Right-click the Local Server item and select Add Project.
3. Define properties of the project (see the following details).

General
Tab

Description

Name

Define a project name.
The project name has to carry out conditions
for file names set in Windows, e.g. question
mark "?" cannot be contained.
The project name will become a directory
name on a disk. See the path where it will be
created in the Settings menu | Options |
Version Manager. The default path can be:
C:\Documents and Settings\user\Application
Data\Quest Software\Toad Data
Modeler\Installation
Name\VersionManager\Server\Project\Projec
t_Name.
All files created in Version Manager will be
saved here until you change the path.
Note: Information on versions (and their
relations to other versions and revisions) are
saved by default to another file. Possible path
is: C:\Documents and
Settings\userName\Application Data\Quest
Software\Toad Data Modeler\Installation
Name\VersionManager\Server\projects.xml
Again, you can change the path in the
Settings menu.

Load Files
in
Directory

Clear (or not to select) this option to create a
new project and let it be empty.

Toad Data Modeler User Guide

505

Projects and Models

Select this option to enable the Directory
box. Click the icon on the right to define a
path to a directory with files that you want to
add to the project. All files stored in the
directory will be added to the project
automatically. Sub- directories will be
ignored.
Description
Tab

Notes on the project should be written on
this tab.

4. If you want to add a group of files to this project, follow the next steps 5 and 6.
You already need to have all the files stored in one directory.
5. Select Load Files in Directory and click the small icon on the right. Find a directory
where files that you want to add to the project are stored.
6. Confirm OK to load all files stored in the directory to the project.

B. Create a New Project + Add an ER Diagram to the Project
1. Create a new model or open an existing one.
2. Click
on the toolbar (or Expert Mode | Version Manager | Add to Version
Manager) to open the New Version Location dialog.
3. If no project exists on your local server, click Add Project

. (And follow step 4.)

If the project where you want to add the model exists on your local server, simply select
it and click OK to add the model to the project.
4. The New Project dialog opens. Define a name and description of your project.
5. Press OK to confirm and turn back to the New Version Location dialog.
6. Select the new project and confirm OK to add the model to the project.
7. The Check Outmessage displays and you are prompted to define a path where your file
should be checked out
8. Confirm OK. The file doesn't exist and therefore will be created.
9. Click Yes. See the Version Manager now. 

Toad Data Modeler User Guide

506

Projects and Models

C. Add a Single File to Existing Project
1. Click

on the toolbar to open Version Manager.

2. Right-click the selected project and click Add File to display a File browser.
3. From the Files of Type box, select the appropriate type, find the file and confirm Open.

D. Summary - Add a Model and File to Existing Project
Model: Open the model and simply click
OK. (See B.)

on the toolbar. Select a project and confirm

Model or any other file: In Version Manager, right-click the selected project and click Add File,
find the file and confirm Open. (See C.)

Related Topics
Version Manager Toolbar and OptionsIn Version Manager, the items are sorted this way:Projects
are listed alphabetically.Under projects, files are listed in the alphabetical order too. Under files,
their versions and revisions are displayed. Versions and revisions of files are sorted in the order
they were created. This sorting allows you to see what version precedes which one, what version
has been derived from which etc. No other sorting is available in Version Manager itself,
however you can sort the items also in the List of Versions and dock the List on Version
Manager. Tip: Searching in the tree of Version Manager: When you need to find a particular
project or file in Version Manager, simply expand the Version Manager item folders and start
typing the project/file name. - This function works for expanded folders (search will not go
through folders that are collapsed). Learn more about options in the Version Manager and its
items. Version Manager ToolbarIconCommandCheck OutCheck InLockUnlockSave Version
asThese options are active for versions/revisions and also file (if you click a file in Version
Manager, the options will relate to its latest version).Note: The options are described in the
Version Right-Click Options section below. Project Right-Click OptionsRight-click a project to
see the following options:OptionDescriptionLock ProjectLocks project not to be overwritten.
Note on the Lock option: Generally, there are two colors of padlock in Version Manager. Blue
padlock means that you are the person who locked the project/file/version, so only you can
modify it. Yellow padlock means that another person locked the project/file/version, so you are
not allowed to make any changes in it unless the project/file/version is unlocked by the
particular person again. Unlock Project Unlocks project.Add FileOpens a dialog where you
select a file that you want to add to the project. Via this option, you can add any file to the
project - Toad Data Modeler model(s) as well as any other files. Remove ProjectRemoves the
selected project including all its files, versions and revisions. If any version/revision is locked,
this option is disabled.Synchronize ProjectSynchronizes latest versions of files of selected project
with files saved on your local computer. (On the server, the latest versions of files will be found
and copied to your local disk.)PropertiesOpens the Project Properties dialog where you can edit a
project name, add a description on the project etc. List of FilesOpens a list of all files of the
project. Here, you can sort the files by name, date of creation, owner etc. File Right-Click

Toad Data Modeler User Guide

507

Projects and Models

OptionsRight-click a file to see the following options:OptionDescriptionLock FileTo preserve
the selected file from overwriting, select this option. Unlock FileUnlocks previously locked
file.Last Version Check-OutOpens the latest version for edit.Last Version Check-InSaves changes
made in the latest version.Add Version (2.0) You have modified a file, saved it and now you
want to add it as a new version. For this purpose, select this option, and find the appropriate file
in the Open dialog. Note: This option is available even though a project is locked, nevertheless,
only provided that a user who's locked it and user who is logged in Version Manager is the same
person. (If it was Administrator who locked the file and a User was logged in, the Add Version
option would be disabled.)Remove from ProjectRemoves a file from project. This option is not
available if any version or revision of this file is locked. Save Version asSaves the latest version
as a standard file (Toad Data Modeler 3.x models with extension .txp or .txl).PropertiesOpens the
File Properties dialog where information on the file name, location, date and time of creation and
last modifications can be found. Tab Lock is read-only and provides information on the lock
hierarchy:Ancestor Locked - It's selected if ancestor (Project in this case) has been locked.
Descendent Locked - It's selected if any descendent of this file has been locked. List of
VersionsDisplays list of versions and revisions of the selected file. Version/Revision Right-Click
OptionsRight-click a version/revision to see the following options:OptionDescriptionLock
VersionTo prevent the selected version from overwriting, select this option. (If the version is
checked out, the version is locked automatically.)Unlock VersionUnlocks previously locked
version. (If you check in the version, it will be unlocked automatically.)How does it work?If you
check out a version, the version locks and the corresponding file on the server becomes readonly, however it is editable in your local file. When you check in the version, the version
unlocks and the corresponding file on the server can be modified. In your local file, it is locked
and becomes read-only.Version lock properties show information on who locked the project and
when. Note: For now, all users in Version Manager are Admins.Check OutOpens the selected
version/revision for edit. Note: Multiple Version Check Out is possible. - Use SHIFT key to
select versions and click Check Out then. Local Directory - Define a path where you want to
load the selected version. Here, the version will be saved and from here, you will work with the
version. The default path is set up in the Settings menu | Options | Version Manager | Local
Directory.Possible path is: C:\Documents and Settings\user\Application Data\Quest
Software\Toad Data Modeler\Installation name\VersionManager\Local\Download\Project_
NameAfter you define and confirm the path, the version will open in the Application Window.
A new version item will appear also in the Application View.The selected version will be
loaded from a server to your local file. The version will be locked automatically on the
server.The version item will appear in the Application View from where you can manage it as
well (see the pop-up menu or main menu toolbar). The version will open in the Application
Window.Check InSaves changes and closes the version/revision. This option is available from
the pop-up menu of the selected version in Version Manager and also in the Application
View.Description - here, you can write description on the version/revision. Finish Work on
Model - select it to close your model during the Check In. Otherwise it remains open.After you
confirm OK, the version will be saved to your local disk and possible changes will be applied
on a server. Version will be automatically unlocked and will become accessible for other team
members. (Projects.xml file is saved after every change made in the project. The file is being
updated continuously - changes made and saved by user A will be visible to user B.) Note:
Multiple Version Check In is possible. - Use SHIFT key to select versions and click Check In
then. Show Version (only to read)Opens the selected version in appropriate associated program,
e.g. Word, Notepad, Windows Viewer, Acrobat Reader etc. Toad Data Modeler models will open

Toad Data Modeler User Guide

508

Projects and Models

in the Application Window.If your file has an extension that does not associate with any
program, it will open in the Version Viewer dialog. On tab Content of Local File, you can see
the text.Add Version (2.0)Adds another version. Add Revision (1.1) Adds another revision.(If
you checked out a version and saved the changes to new a version or revision, the result would
be the same as if you used these options.)Remove VersionRemoves the selected version and all
its revisions.Exclude VersionExcludes only the selected version, its revisions will remain.Save
Version asSaves the selected version as a standard file (Toad Data Modeler models with
extension .txp or .txl).PropertiesOpens the Version Properties dialog. On tab Notes, you can
define notes on the version/revision. Related TopicsList of Projects, Files, Versions (page 1)
Version Manager Toolbar and Options
In Version Manager, the items are sorted this way:
l

Projects are listed alphabetically.

l

Under projects, files are listed in the alphabetical order too. Under files, their versions and
revisions are displayed.

l

Versions and revisions of files are sorted in the order they were created. This sorting
allows you to see what version precedes which one, what version has been derived from
which etc. No other sorting is available in Version Manager itself, however you can sort
the items also in the List of Versions and dock the List on Version Manager.

Tip: Searching in the tree of Version Manager: When you need to find a particular project or file
in Version Manager, simply expand the Version Manager item folders and start typing the
project/file name. - This function works for expanded folders (search will not go through folders
that are collapsed).
Learn more about options in the Version Manager and its items.

Version Manager Toolbar
Icon

Command
Check Out
Check In
Lock
Unlock
Save Version
as

Toad Data Modeler User Guide
Projects and Models

These options are active for versions/revisions and also file (if you click a file in Version
Manager, the options will relate to its latest version).
Note: The options are described in the Version Right-Click Options section below.

Project Right-Click Options
Right-click a project to see the following options:
Option

Description

Lock
Project

Locks project not to be overwritten.

Unlock
Project

Unlocks project.

Add File

Opens a dialog where you select a file that you want to
add to the project. Via this option, you can add any file
to the project - Toad Data Modeler model(s) as well as
any other files.

Remove
Project

Removes the selected project including all its files,
versions and revisions. If any version/revision is locked,
this option is disabled.

Synchronize
Project

Synchronizes latest versions of files of selected project
with files saved on your local computer. (On the server,
the latest versions of files will be found and copied to
your local disk.)

Properties

Opens the Project Properties dialog where you can edit
a project name, add a description on the project etc.

List of Files

Opens a list of all files of the project. Here, you can sort
the files by name, date of creation, owner etc.

Note on the Lock option: Generally, there are two colors
of padlock in Version Manager. Blue padlock means that
you are the person who locked the project/file/version,
so only you can modify it. Yellow padlock means that
another person locked the project/file/version, so you are
not allowed to make any changes in it unless the
project/file/version is unlocked by the particular person
again.

509

Toad Data Modeler User Guide
Projects and Models

File Right-Click Options
Right-click a file to see the following options:
Option

Description

Lock File

To preserve the selected file from overwriting, select this
option.

Unlock
File

Unlocks previously locked file.

Last
Version
Check-Out

Opens the latest version for edit.

Last
Version
Check-In

Saves changes made in the latest version.

Add
Version
(2.0)

You have modified a file, saved it and now you want to
add it as a new version. For this purpose, select this
option, and find the appropriate file in the Open dialog.
Note: This option is available even though a project is
locked, nevertheless, only provided that a user who's
locked it and user who is logged in Version Manager is
the same person. (If it was Administrator who locked the
file and a User was logged in, the Add Version option
would be disabled.)

Remove
from
Project

Removes a file from project. This option is not available
if any version or revision of this file is locked.

Save
Version as

Saves the latest version as a standard file (Toad Data
Modeler 3.x models with extension .txp or .txl).

Properties

Opens the File Properties dialog where information on
the file name, location, date and time of creation and last
modifications can be found. Tab Lock is read-only and
provides information on the lock hierarchy:
Ancestor Locked - It's selected if ancestor (Project in this
case) has been locked.
Descendent Locked - It's selected if any descendent of
this file has been locked.

List of
Versions

Displays list of versions and revisions of the selected file.

510

Toad Data Modeler User Guide
Projects and Models

Version/Revision Right-Click Options
Right-click a version/revision to see the following options:
Option

Description

Lock
Version

To prevent the selected version from overwriting, select
this option. (If the version is checked out, the version is
locked automatically.)

Unlock
Version

Unlocks previously locked version. (If you check in the
version, it will be unlocked automatically.)
How does it work?
If you check out a version, the version locks and the
corresponding file on the server becomes read-only,
however it is editable in your local file.
When you check in the version, the version unlocks and
the corresponding file on the server can be modified. In
your local file, it is locked and becomes read-only.
Version lock properties show information on who locked
the project and when.
Note: For now, all users in Version Manager are Admins.

Check Out

Opens the selected version/revision for edit.
Note: Multiple Version Check Out is possible. - Use
SHIFT key to select versions and click Check Out then.
Local Directory - Define a path where you want to load
the selected version. Here, the version will be saved and
from here, you will work with the version. The default
path is set up in the Settings menu | Options | Version
Manager | Local Directory.
Possible path is: C:\Documents and
Settings\user\Application Data\Quest Software\Toad Data
Modeler\Installation
name\VersionManager\Local\Download\Project_Name
After you define and confirm the path, the version will
open in the Application Window. A new version item
will appear also in the Application View.
l

The selected version will be loaded from a server
to your local file. The version will be locked
automatically on the server.

511

Toad Data Modeler User Guide
Projects and Models

Option

Check In

Description
l

The version item will appear in the Application
View from where you can manage it as well (see
the pop-up menu or main menu toolbar).

l

The version will open in the Application
Window.

Saves changes and closes the version/revision. This
option is available from the pop-up menu of the selected
version in Version Manager and also in the Application
View.
Description - here, you can write description on the
version/revision.
Finish Work on Model - select it to close your model
during the Check In. Otherwise it remains open.
After you confirm OK, the version will be saved to your
local disk and possible changes will be applied on a
server. Version will be automatically unlocked and will
become accessible for other team members. (Projects.xml
file is saved after every change made in the project. The
file is being updated continuously - changes made and
saved by user A will be visible to user B.)
Note: Multiple Version Check In is possible. - Use SHIFT
key to select versions and click Check In then.

Show
Version
(only to
read)

Opens the selected version in appropriate associated
program, e.g. Word, Notepad, Windows Viewer, Acrobat
Reader etc. Toad Data Modeler models will open in the
Application Window.
If your file has an extension that does not associate with
any program, it will open in the Version Viewer dialog.
On tab Content of Local File, you can see the text.

Add
Version
(2.0)

Adds another version.

Add
Revision
(1.1)

Adds another revision.

Remove
Version

Removes the selected version and all its revisions.

(If you checked out a version and saved the changes to
new a version or revision, the result would be the same as
if you used these options.)

512

Toad Data Modeler User Guide

513

Projects and Models

Option

Description

Exclude
Version

Excludes only the selected version, its revisions will
remain.

Save
Version as

Saves the selected version as a standard file (Toad Data
Modeler models with extension .txp or .txl).

Properties

Opens the Version Properties dialog. On tab Notes, you
can define notes on the version/revision.

Related Topics
List of Projects, Files, Versions (page 513)
List of Projects, Files, Versions
The List displays information on items in Version Manager - projects, files and versions. Here,
you can sort the items by different conditions (by name, version number, date of creation etc.),
however you are not able to edit them.
The List opens together with Version Manager. You can dock it wherever you want. If you close
it, you can find it later in appropriate pop-up menus of items in Version Manager. E.g. Rightclick the server and select List of Projects
Tip: You don't have to close the List of Projects to open List of Files. To see all files of the
selected project, simply click the project in the Version Manager tree and the List of Projects
will change to List of Files automatically. To see all versions/revisions of a file, simply click a
file in Version Manager tree to display the List of Versions.
Click a column to sort the data by:
l

Name - in alphabetical order

l

Owner

l

Created - chronologically by date of creation

l

Changed - chronologically by date of a change

l

Locked - locked items will be moved at the beginning or at the end of the list

l

Lock Time - chronologically by time of locking an item

l

Description - items with description will be moved at the beginning or at the end
of the list

Note: Column width automatically adjusts to its content.

Toad Data Modeler User Guide

514

Projects and Models

Tips and Tricks
Connection Strings for Reverse Engineering
MySQL
scheme://user_name[:password]@host_name[:port_num]/db_name/tbl_name
Where:
l

scheme — is a recognized connection protocol. Only mysql is supported as the scheme
value at this point.

l

user_name — the user name for the connection. This user must have been created on the
remote server, and must have suitable privileges to perform the required actions (SELECT,
INSERT, UPDATE etc.) on the remote table.

l

password — (optional) the corresponding password for username.

l

host_name — the hostname or IP address of the remote server.

l

port_num — (optional) the port number for the remote server. The default is 3306.

l

db_name — the name of the database holding the remote table.

l

table_name — the name of the remote table. The name of the local and the remote table
do not have to match.

Examples:
CONNECTION='mysql://username:[email protected]:port/database/tablename'
CONNECTION='mysql://[email protected]/database/tablename'
CONNECTION='mysql://username:[email protected]/database/tablename'

Oracle - via Oracle Client
Home=home;NetServiceName=net_service_name_no;UserId=user_name;

Oracle - via TCP/IP
HostName=host_name;Port=port_no;ServiceName=service_name;UserId=user_name;

PostgreSQL
HOSTNAME=host_name;PORT=port_no;DATABASE=database_name;USERId=user_
name;PASSWORD=password;

Toad Data Modeler User Guide

515

Projects and Models

Sybase ASE
SERVERNAME=server_name;DATABASE=database_name;USERId=user_
name;PASSWORD=password;

Microsoft SQL 2000
server,port:database

Rename
To rename your model name
»

Right-click the model name in Model Explorer (or Application View) and select
Rename.

To rename objects on Workspace
1. Select the object (entity, view etc.), press F2 or CTRL+double-click the object name.
2. Write a new name.
3. Click the Workspace then.
To rename object in Model Explorer
»

Select the object and press F2 or right-click and select Rename.

Related Topics
Inplace Editor

Shift and Zoom in Your Model
Toad Data Modeler allows you to shift among pages of your large model very fast, zoom
different objects of the same Workspace or display the same object on the same WS in a different
zoom (another Designer for the selected WS has to be opened) etc.
For this purpose, the following functions can be used:
l

Zoom (Zoom In, Zoom Out, Zoom Box)

l

Loupe (magnifier glass)

l

Overview (navigator)

l

Move

Toad Data Modeler User Guide

516

Projects and Models

All these functions are available in the View menu, or via icons on the toolbar. See "View
Menu" (page 50) for more information

Navigation Tips on Workspace
l

CTRL + scroll mouse to zoom in/zoom out

l

CTRL +, CTRL + Page Up to zoom in

l

CTRL-, CTRL+ Page Down to zoom out

l

Scroll mouse to move up/down on the Workspace

l

SHIFT + scroll mouse to move to the right/left on the Workspace

l

Holding down the middle button to move on entire page/Workspace

l

Page Down, CTRL + down to move to next page

l

Page Up, CTRL + up to move to previous page

l

CTRL + left to move to the left page

l

CTRL + right to move to the right page

l

Click

to fit your entire ERD to screen.

Tips and Hints for Large Models
Topics:
l

How to divide your large model?

l

How to work concurrently in two or more places of the same Workspace?

l

How to display related entities, which are far from each other, close to each other?

l

How to transparently display an entity that has a lot of relationships in your ER diagram?

l

How to colorfully distinguish entities in your model?

l

How to select objects in ERD by schema or category?

l

Print large model

l

HTML Report Layout

How to divide your large model?
»

Create new Workspaces!

Workspaces (WS) are similar to submodels. A model can have as many WS as you need. Each
WS can display different (or same) parts (objects) of your large model. Each WS can have a

Toad Data Modeler User Guide

517

Projects and Models

different format or display view. On the Workspaces, you can manage your model objects
quickly, easily and comfortably.
To create a new WS, simply click

on the toolbar.

See "Designer and Workspace" (page 39) for more information.

How to work concurrently in two or more places on the same
Workspace?
»

Open another Designer for your Workspace (WS)!

Designer displays a Workspace (WS). You can open as many Designers (tabs) for the selected
WS as you need. This allows you to display different parts of the same WS and also the same
objects of the WS in a different zoom.
See "Designer and Workspace" (page 39) for more information.

Scenario
Your model has one Workspace WS1. WS 1 represents main model and
is large. You need to work with two parts of the model concurrently.
1. Right-click Workspace1 item in the Application View or Model Explorer and select
Open Designer. -> Another tab of the same name - Workspace1 will open in the
Application Window. It displays the same objects.
Scenario: You're working in the second Designer and need to move fast to find the required
part/objects that you need to edit.
2. Click

on the toolbar.

In the Overview dialog, use drag&drop techniques to move the small frame in the
Overview dialog. -> You will move on the WS1 at the same time. Change size of the
frame at your convenience to zoom in or out the objects on the WS.
3. Find the required objects. (You can close the Overview dialog then.)
4. Now you can comfortably work in two places of the same WS at the same time.
- You can switch between the two Designers (tabs Workspace1).
- You can undock one of the Designers and see them in one screen, or move it to your
second monitor if you have any.

Toad Data Modeler User Guide

518

Projects and Models

How to display related entities, which are far from each other, close to
each other?
»

Create an entity shortcut!

Entity shortcut is another graphical representative of an entity. It's not a copy but the same object
with the same properties. You can create as many shortcuts of an entity as you need (and of
course, not only entities...).
See "Shortcuts of Objects" (page 72) for more information.

Scenario
Entity1 and Entity42 are related, however each is on a different page.
You want to see them closer to each other.
Scenario: Create a shortcut of the Entity 1 and place it next to the Entity 42. (You can also
create a shortcut of the Entity 42 and place it to the Entity 1.):
1. Find Entity 1 on the Workspace.
2. Find Entity 42 in Model Explorer.
3. Click the Entity 42 item and drag it to the WS where you want to add the shortcut, next
to the Entity1.

How to transparently display entity that has a lot of relationships?
»

Create an entity shortcut and move shortcuts of some relationships to it!

Scenario
Entity Film has five relationships leading from or to it. You want to
create a shortcut of this entity, place it next to it, and move two
relationships to it.
Scenario: Create an entity shortcut on the Workspace.
1. Click the Film entity on the WS and hold the mouse key down.
2. Press CTRL+SHIFT keys and hold them down.
3. Drag the Film entity on the WS.
4. Release the mouse button and then the keys.
Result: There are two shortcuts of the Film entity on the WS - Film : 1 and Film : 2.
Scenario: Create shortcuts of the two relationships of the Film entity.

Toad Data Modeler User Guide

519

Projects and Models

5. Right-click the WS and select Add Selected Objects to Workspace.
6. From the dialog, select the relationships that you want to 'redirect' to the Film : 2
shortcut. (See the object details next to the relationship name in the dialog).
7. Confirm your selection.
Result: There are two shortcuts of the two selected relationships connected to the Film : 2
entity shortcut.
Scenario: Remove redundant relationship shortcuts of the Film  : 1 shortcut.
8. Select the two needless relationship shortcuts on the WS (use SHIFT for multiple
selection).
9. Press Delete.
Result: The selected shortcuts will be removed from the WS.

How to colorfully distinguish entities in your model?
»

Assign selected entities to a Category!

Categories allow you to colorfully distinguish entities that logically go together. Each entity can
be assigned only to one category.
See "Categories" (page 381) for more information.

Scenario
You want to distinguish all entities that contain information on your
customers on the Workspace.
1. Right-click the Categories item in Model Explorer and click Add Category.
2. Double-click the new category.
3. Define properties of the category - its name ( Customer Info ) and select a color
(Money Green).
4. On tab Objects, select entities that you want to assign to the category.
5. Confirm OK.
Result: All the selected entities will have Money Green background color on all
Workspaces of the model.
Scenario: As you have many categories in your model, you want to display a caption of
categories on the Workspace.
6. Click

on the toolbar.

7. Click the work area where you want to place the caption.

Toad Data Modeler User Guide

520

Projects and Models

Scenario: You want to display the entities of the category in Model Explorer (they will be
Money Green in Model Explorer).
8. Right-click the Model Explorer and select Settings.
9. Select the Use Colors of Category to Draw checkbox.
See "Caption of Categories and Shortcuts" (page 83) for more information.

How to select objects in ERD by schema or category?
»

Right-click the Workspace and select Select Objects.

Print Large Model
l

Is Print to PDF Possible?

Yes, you may try to print your ER diagram to PDF using "PDF printer". Note: not all PDF
printers are supported.
l

Can I print whole ER diagram on one page?

Yes. In the Page Format dialog, select the Fit to Page checkbox.
l

Is there a way to speed up the printing process?

Yes. Disable graphical options. Either select Settings | Options | General, clear the Print
Gradients checkbox (it is disabled by default) or disable the graphical options Gradient Effect,
Graphical Display of Keys etc. in the Workspace Format dialog.

HTML Report Layout
For large models, select Frames - top menu or Frames - left menu options. (Frameless report
layout is not recommended as it uses Java script that goes through all objects, which takes too
much time if your model is large.)
See "Reports" (page 319) for more information.

Other Quick Tips
Objects on the Workspace and Keyboard Arrows
l

Move entities on the Workspace via keyboard arrows.
Tip: To set up the size of a step to move, select Settings | Options | Graphics |

Toad Data Modeler User Guide

521

Projects and Models

Move Objects by (mm/10) (in tenths of milimeters).
l

Select an entity on the Workspace, press SHIFT, hold it down and use the keyboard
arrows to change size of the entity box.

Navigation on the Workspace
l

CTRL + scroll mouse to zoom in/zoom out

l

CTRL +, CTRL + Page Up to zoom in

l

CTRL-, CTRL+ Page Down to zoom out

l

Scroll mouse to move up/down on the Workspace

l

SHIFT + scroll mouse to move to the right/left on the Workspace

l

Holding down the middle button to move on entire page/Workspace

l

Page Down, CTRL + down to move to next page

l

Page Up, CTRL + up to move to previous page

l

CTRL + left to move to the left page

l

CTRL + right to move to the right page

l

Click

l

Press F11 to display the application in full screen mode.

to fit your entire ERD to screen.

Make a Copy of Multiple Objects on the Workspace (CTRL+A,
CTRL+C, CTRL+V)
l

Before you press CTRL + V to paste the objects, close the Model Explorer pane to
accomplish the operation much faster.
Note: The larger your model is, the more significant difference in speed you
will notice.

Print Models
l

In Settings | Options | General, clear the Print Gradients checkbox for much faster print
performance. (It is disabled by default.)

HTML Report Layout
l

For large models, Frames - top menu or Frames - left menu options are recommended.
Note: Frameless report layout is not recommended as it uses Java script that goes
through all objects, which takes too much time if your model is large.

Toad Data Modeler User Guide

522

Projects and Models

Scripting and Customization
About Scripting and Customization
Toad Data Modeler is based on an object-oriented model. Every entity, attribute etc. is an object
defined either in the Toad Data Modeler core or in a special type of models that are called
metamodels. You can visually create or modify classes and their properties or methods in
metamodels, and affect default behavior of Toad Data Modeler objects or create new objects.
In general, Toad Data Modeler 3.x is a "scriptable" application and every object can be
easily modified. It is a highly customizable software that you can adjust to fit your needs
and requirements. Examples can be found in system packages that are accessible via Package
Explorer.
The options to customize Toad Data Modeler are available for advanced users and experts.
Expert Mode has to be enabled.

Scripts
Code written in JScript, VBScript or Internal script. Via scripting and using the scripts, you can
access plenty of objects in Toad Data Modeler, rename objects, merge models, customize
generated SQL code etc.
Scripts are accessible via Script Explorer.

Toad Data Modeler User Guide

523

Projects and Models

Sample script:
function main()

      var e, Entity;
      for (e=0; e<Model.Entities.Count; e++)
{
            Entity = Model.Entities.GetObject(e);
            Log.Information(Entity.Name); // writes Entity Names to
Log.
      }
}

Packages
A group of scripts, customized Form definitions, metamodels etc. Packages are accessible via
Package Explorer. In general, Package Explorer contains packages with scripts for supported

Toad Data Modeler User Guide
Projects and Models

databases, particular model types and other functions such as reverse engineering, report
generation etc.

Script Editor
A place where you can edit a source code of your scripts.
To open Script Editor
»

Select a script in Script Explorer and double-click it (or right-click and select Edit
Source Code).
or
Open Package Explorer, select a script, right-click it and select Edit
Source Code.

524

Toad Data Modeler User Guide

525

Projects and Models

Scripting Window
A place from where you can execute scripts without the necessity to store the code (similar to
MS Scripting window in Toad Data Modeler 2.x ).
To open Scripting Window
»

Select Expert Mode | Scripting Window.

Toad Data Modeler User Guide

526

Projects and Models

Metamodel
Graphical representation of objects (classes, properties, methods...) that belong to the selected
package. In metamodels, you can create new classes, properties, methods, associations,
generalizations... It is very similar to UML Class Diagram.

Other Notes
Script Modifications in Toad Data Modeler 3.x and in Toad Data
Modeler 2.x - Comparison
Generally, in Toad Data Modeler 2.x it was necessary to copy a system template to the user
defined section to be able to make some modifications. The user defined templates had higher
priority than system templates.
System packages and system scripts in Toad Data Modeler 3.x are accessible via the Script and
Package Explorers. They are marked as read-only and are locked by default. If you want to
modify a system script in Toad Data Modeler 3.x, you do not need to copy it anywhere. You
simply create a new script that you can modify at your convenience then. This way you can
extend functionality of the system script, change its behaviour etc.
Toad Data Modeler Priority Rules
1. Scripts and definitions stored in My Package.txg file have the highest priority.

Toad Data Modeler User Guide

527

Projects and Models

2. Scripts and definitions stored in other user defined packages (distributed as add-ons, add-on
packages) have higher priority than scripts and definitions stored in system packages.
3. Scripts and definitions stored in system packages have the lowest priority.
Note: System scripts are contained in system packages that are read-only as well. Nevertheless,
it is possible to unlock them to be able to edit their source code - just change the attribute of
particular file on your disk. In any case, we do NOT recommend to modify source code of
system scripts.
Documentation - Toad Data Modeler Reference
More information about available classes, methods, properties is contained in the Toad Data
Modeler Reference document where you can find all objects defined in the application as well as
all objects defined in metamodels.
This document is available in the Expert Mode | Reference Guide menu (for Expert Mode on).

Related Topics
Expert Mode
MetamodelAbout Metamodel in Toad Data Modeler Toad Data Modeler supports metamodels.
Metamodels are available only in Expert Mode (via Package Explorer).Metamodel is a graphical
representative of objects (classes, properties, methods...) that belong to the selected package, or
references to objects defined in the application. In metamodels, you can create new classes,
properties, methods, associations, generalizations (it is very similar to UML Class Diagram).
Metamodels are available for creation or modifications of:ClassesPropertiesMethods (Functions
and Procedures)You can also model associations and generalizations, add notes and other logical
data to metamodels. Note: In your metamodel, it is recommended to use only ANSI code (A - B
without any special characters and numbers). Example: Oracle package metamodel  (page 1)
Package Explorer (page 527)
Script Explorer (page 531)
Script Editor (page 535)

Package Explorer
Package Explorer displays structure of packages in Toad Data Modeler. Package Explorer
allows you to:
l

Manage objects saved in the packages (rename objects, move and copy them, open
metamodel for packages, open object Properties dialog etc.)

l

Access all Metamodels

Toad Data Modeler User Guide

528

Projects and Models

To open Package Explorer
1. Enable Expert mode: select Settings | Options | General | select the Expert
Mode checkbox.
2. Click

on the toolbar or select Expert Mode | Customization |Package Explorer.

Toad Data Modeler contains packages for:
l

Particular supported databases (e.g. Oracle, MS SQL Server 2005, MySQL 5.0 etc.)

l

Physical ER models

l

Logical models

l

HTML and RTF reports

l

and other functions, such as e.g. SQL/DDL generation, reverse engineering etc.

The Package Explorer Tree
Via the box at the top, you can filter the list of packages.

You can edit only the packages/scripts that are not read-only.
Root folders contain packages that have various lists of objects, e.g.:

Toad Data Modeler User Guide

529

Projects and Models

l

Forms Definitions - contain partial definitions with a list of changed visual components
of forms modified by user

l

External Class Definitions- contain classes and their members designed by user (see the
"Metamodel" topic)

l

Package Dependencies - show dependencies between the selected package and other
packages

and others.

Options for Packages
Right-click a package in Package Explorer to see the following options:
Option

Description

Load Package

Loads all information on the package from disk to
internal Toad Data Modeler data structures. For faster
work with packages and for faster loading of
application, some information is loaded only on
demand.

Delete Package

Deletes the selected package with all its objects.

Disallow
Package

Selected package will not be loaded during next
Toad Data Modeler start-up.

Open
Metamodel

Opens metamodel related to the selected package (see
the "Metamodel" topic).

Extend with
New Package

Creates a new package that will extend the actual
package.

Create
Dependent
Package

Creates a new package that will depend on the actual
package (will inherit from it).

Properties

Contains information on the selected package and its
items (General information, Visibility, Script folders,
Scripts, Description). From here, you can also
manage the items - add, delete, edit. (See the
following example.)
Package File box in the Package Properties dialog Path to the location where the package is stored.
Click the button on the right to get to the location
straight away.

Toad Data Modeler User Guide

530

Projects and Models

Package Explorer Toolbar
Icon

Command
Save Actual - saves changes to
actually active package
Save All - saves all changes
made in all modified packages
Creates a new user package.
Adds an existing package to the
Package Explorer.
Hides all system packages for
quicker search among packages.

Icons of Packages in Package Explorer
Packag
e

Unlocked

Type of
Packag
e/State

Lo
ade
d

Loa
dedMo
difie
d

Locked

Unl
oade
d

Disall
owed

Lo
ade
d

Unl
oade
d

Disall
owed

System
Add-On
-

My
Packag
e
State

Description

Locked

A package is locked when:

-

a) is read-only on the disk*,
b) it is a system package and user does not work in
Expert mode.

Err
or
duri
ng
Loa
din
g

Toad Data Modeler User Guide

531

Projects and Models

State

Description
*Note: All system packages are read-only by default.
However, in Expert mode it is possible to change the
lock/unlock property of the package (right-click the
package in Package Explorer | Properties.) Generally, in
Expert mode it is possible to lock/unlock system
packages and add-on packages.

Loaded

Complete package has been loaded to memory.

Loaded Modified

Package has been modified by user.

Unloaded

Package has not been loaded to memory.

Disallowed

Package has been disallowed by user (right- click the
package in Package Explorer | Disallow Package).

Error
during
Loading

Loading of the package failed. It is an error state. This
situation can happen e.g. when a dependent package of
this package is missing (for example it was not selected
during installation of the application).
Note: It is not possible to edit a script when package is
locked. Unlock a package to edit its scripts.

Script Explorer
In Script Explorer, you can edit existing scripts, write your own scripts and more.
To open Script Explorer
1. Enable Expert mode: select Settings | Options | General | select the Expert
Mode checkbox.
2. Click

on the toolbar or select Expert Mode | Customization |Script Explorer.

Script Explorer doesn't contain all data that you can find in Package Explorer, but only scripts
stored in folders.
Via the Script Explorer, you can:
l

Make petty modifications in user scripts - see option Edit Source Code(in New Window)

l

View source code of read-only scripts (via the Edit Source Code option as well), and
copy their parts to use them in new scripts

Toad Data Modeler User Guide

532

Projects and Models

l

Extend functionality of existing scripts and modify them significantly - see option Add
New Script

l

Delete user scripts

See "Scripting in Script Editor" (page 537) for more informationome examples.

The Script Explorer Tree

From the combo-box at the top, you can select a script for:
l

All Models

l

Physical Model and particular database

l

Metamodel

l

Logical Model

Example: See the screenshot above - item All Models have been selected. The scripts with
visibility All Models are displayed.

Toad Data Modeler User Guide

533

Projects and Models

Options for Folders
Folders (Script Categories):
l

Constants - scripts with constants

l

CSAO Class Definitions - scripts with class definitions, in majority of cases categorized
to folders by database names

l

Dictionaries - contains script with dictionaries

l

Form Events - contains scripts with events

l

Reports - contains scripts for HTML and RTF reports

l

Reverse engineering - contains scripts for loading a model via reverse engineering

l

Verification - contains scripts for verification

Right-click a folder to see the following options:
Option

Description

Add New
Script

Adds a new script under the selected folder.

Delete
Folder

Deletes the selected folder, including its content.

Add New
Folder

Adds a new folder under the selected folder.

Properties

Opens the Properties dialog of the selected folder From
here, you can also manage items of the folder - add,
delete and edit them. However, only provided that the
folder is not read-only.

General
Tab

This tab contains some basic information on the folder.

Items Tab

All sub-folders and scripts of particular folder are listed
on this tab. Here, you can also manage them - add, edit,
delete. (Provided that they are not read-only.)

Folders with system scripts cannot be deleted. They
are locked (see the padlock icon).

Toad Data Modeler User Guide
Projects and Models

Options for Scripts
Right-click a script to see the following options:
Option

Description

Delete
Script

Deletes the selected script. If this script contains other
script items, they will be also deleted.
System scripts cannot be deleted. They are locked
(see the padlock icon). It's not possible to delete other
read-only scripts either.

Edit
Source
Code

Edit
Source
Code in
New
Window

Opens Script Editor in the Application Window.
This option is available for all scripts - user, system and
read-only scripts. Nevertheless, the difference is the
following:
l

User scripts that are not locked: You can edit the
source code of the script directly.

l

System scripts and read-only scripts: You can
only look over the script and copy its parts to
another script or a new script. You are not allowed
to edit source code of such scripts directly.

Same as above, however the source code of the selected
script will open in a new window in Script Editor.
Tip: You can open a source code of the same script twice
or more times. You can see the code in one window, and
edit it concurrently in the other window.
If any of the Edit options is selected, the script will be
locked automatically, and other modifications of this
script will not be allowed. (In Script Explorer, such
scripts are disabled.)

Properties

Opens the Script Properties dialog. Properties of system
and read-only scripts cannot be edited.

Script Properties
General
Tab

Description

Name

Physical Script Name

534

Toad Data Modeler User Guide

535

Projects and Models

Caption

Logical Script Name

Category

Select a script category (folder) to which you want to
assign the script.

Language

Select either the Language Independent item or any
language for the script.

Script
Type

Select Script Type: JScript, VBScript and Internal script
are available.

Package

Name of a package where the script is saved. User scripts
are saved to "My Package".
Scripts are saved by default to a path set up in the
Settings menu | Options | Application section | Paths |
Path to Packages.

Script
Folder

Name of folder or name of script where the selected script
is saved. This item is always disabled and cannot be
changed in this dialog.

Visibility
Tab

On this tab, you can find information on the script
visibility.
It's a place where you can define visibility for your user
scripts. - Specify use of the scripts for particular database
or model type.
All Models - If it's selected, the script can be used for any
model no matter what type or database it is of.
If it's cleared, other options become available. Select a
model type (Physical, Logical, Metamodel), or database or
both.

Others
Tab

Information on script author, company, version, script
history.

Notes Tab

A tab for notes on the script.

Script Editor
In Script Editor, you can edit and view scripts. Script Editor is accessible from Script Explorer
or Package Explorer.
To open Script Editor
»

Right-click the selected script and select Edit Source Code or Edit Source Code
in New Window.

Toad Data Modeler User Guide

536

Projects and Models

In the Application Window, a new tab Scripts will display. On this tab, you can manage all
scripts that you open either for edit or view.
Read-only scripts (system scripts and locked scripts) can be only viewed. Nevertheless, their parts
can be copied to new scripts.
Other scripts can be edited in their source code directly in the right window of the Script Editor.
Left Window of Script Editor

List of functions of the selected script

Commit

Confirms changes made in the script.
When you close the application, the
changes will be automatically saved
in appropriate package on the disk.

Commit and Save

Confirms changes made in the script
and saves the particular package at
the same time (also in Script menu |
Accept Modifications).

Rollback

Cancels changes.

Tip: Double-click a function in the list to display the selected function
in the source code in the right window of Script Editor.
Right Window of Script
Editor

Shows source code of selected script.

Tips:
l

Insert a bookmark on selected line:
1. Press CTRL+SHIFT+Number 0..9 to insert a
bookmark on selected row.
2. To call the bookmark then, press
CTRL+appropriate number.
3. Place a mouse cursor on the selected script line.

l

Select Edit | Find in Scripts or press CTRL+ALT+F to open a
dialog via which you can search a text in all existing scripts.

Toad Data Modeler User Guide

537

Projects and Models

Script Editor Right-Click Options

These are standard functions that can be used while working with scripts in Script Editor.
Convert
Internal Script

Option for internal scripts that allows you to see your
internal script in JScript.

Convert
Internal Script
2

Option for internal scripts that allows you to see your
internal script in JScript. Moreover, via this option,
you can see numbers of lines that you can map in
case of errors in the script.

Note: If an error occurs and it is an error in script, the script will open in Script Editor and the
particular problematic line in the script will be highlighted. (Expert mode must be enabled.)

Related Topics
Scripting in Script Editor (page 537)

Scripting in Script Editor
In Toad Data Modeler, you can create and edit scripts via Script Explorer and Package Explorer.
For scripting purposes, Script Explorer should be used. (See "Script Explorer" (page 531) for more
information.)
To create a new script
»

Select a script/folder in Script Explorer | right-click and select Create New Script.

Toad Data Modeler User Guide

538

Projects and Models

To edit already existing script
»

Select a script/folder in Script Explorer | right-click and select Edit Source Code(in
New Window).

In both cases Script Editor opens.
When you modify a script source code or write a new script code:
l

The particular script is locked and no other user can modify it.

l

The script is disabled in Script and Package Explorers.

l

Use Commit to save the changes and Rollback to cancel the changes in Script Editor. As
soon as you press any of these buttons, the script becomes available for other users (will
be unlocked automatically).
Note: After you click Commit, the changes you've made for the script will be
saved within the TDM application, however they will not be saved in particular
package on your disk (My Package). You can either save the package in Package
Explorer, or close the application - the changes will be saved in appropriate
package and on disk automatically.

Scripting Languages in Toad Data Modeler:
l

JScript

l

Visual Basic

l

Internal Script -See "Internal Scripting" (page 539) for more information.

To make a petty script modification
(It doesn't work for read-only scripts.)
1. In Script Explorer, select a script that you want to modify.
2. Right-click the script and select Edit Source Code.
3. In the Script Editor, edit the source code directly.
4. Press Commit to confirm changes, or Rollback to cancel the changes.
5. Save the changes in appropriate package and on your disk - Click
Explorer.

in Package

To modify functions of system scripts
System scripts are read-only and it's not possible to edit their source code directly. (See disabled
Commit and Rollback icons in Script Editor.)
If you want to edit any functions of a system script, you have to create a new script and edit
appropriate functions in it. For detailed example, please see User Guide, "Customization Sample" chapter.

Toad Data Modeler User Guide

539

Projects and Models

To write a new script from scratch
In Toad Data Modeler, you can create a new script or further extend functionality of already
existing scripts - user and also system scripts.
1. Open Script Explorer.
2. Select a folder (category) where you want to add the new script.
3. Right-click the selected folder and select Add New Script. -> A new item will display in
the Script Explorer under the selected folder.
4. Double-click the new script to open it in Script Editor.
5. Write or insert the scripting code to the right window. Use Commit or Rollback for
saving and canceling the changes. Remember to save the changes in the package too.

Internal Scripting
In Toad Data Modeler, the following scripts are supported:
l

JScript

l

Visual Basic

l

Internal Script

Use the internal script for writing more extensive texts where only few commands are contained.
The internal script is similar to markup languages such as XML, HTML etc.
Every sign that is not a text must be marked by this sign - "#".

Key Words
l

import

l

require

l

if

l

else

l

endif

l

script - Script function is generated. It allows users to define script type (e.g. JScript or
VBScript) where the content between script and endscript commands is written.

l

endscript

l

proc - Creates a function in JScript. It is possible to define parameters here.

l

endproc -

l

call - Calls a procedure (function). It is possible to define parameters here.

Toad Data Modeler User Guide
Projects and Models

l

<% - Beginning of macro.

l

%> - End of macro.

l

Forall - Executes iteration over list.

l

@ - Shows that the following text is an expression.

"script" Command
Use this command to insert to the internal script another part of a scripting language.
#script language=”{Scripting language}”
{Code of Scripting Language}
#endscript

Example:
#script language="Jscript"
function something() {
  Log.Infomation(‘My Message’);
}
#endscript

"proc" and "endproc" Command
Use this command to create a procedure that is available in internal language.
#proc
  Name([parameters])
    Code of Procedure
#endproc

Example:
#proc
    Greetings()
      Hello
      Buy
  #endproc

540

Toad Data Modeler User Guide

541

Projects and Models

"Call" Command
Use this command to call procedures defined by command "proc".
Example:
#call Greetings()

"forall" Command
Use this command if you want to execute iteration over a list. The result of the iteration should
be a text.
Command syntax is the following:
#forall LIST_NAME (PARAM1, PARAM2, PARAM3, PARAM4, PARAM5 );

Example:
#forall Model.tables('Create Table'+IterateItem.Name+'(','',GenerateColumns(),',',')' );

"<%", "%>" Command
Angled brackets with percentage insert part of internal script where JScript is used (or another
scripting language). The expression is evaluated immediately.
Example:
<% if (Model.Count>0) Log.Information(‘something’); %>

"@" Command
It is similar to "<% %>", however the difference is that after the @ sign, only one
expression follows.

Scripting Window
Scripting Window allows you to run simple scripts only. In the Scripting Window, you cannot
save scripts as they do not relate to any package.
To open Scripting Window
1. Enable Expert mode: select Settings | Options | General | select the Expert
Mode checkbox.

Toad Data Modeler User Guide

542

Projects and Models

2. Select Expert Mode | Scripting Window.
In the Application Window, see the new tab Scripting with the Scripting Window open.

To display/hide toolbar for Scripting Window
»

Select View | Toolbars | Scripting Window.
Icon

Command
Show windows
automatically
Show/hide Log
Show/hide Code
Explorer
Execute script
Stop script
Script type
selection box
Load script from
file
Save script to a

Toad Data Modeler User Guide

543

Projects and Models

Icon

Command
file
Save script as
Minimize all
undocked forms

To display the Available Objects and the Selected Objects windows in Scripting Window
»

Select View | Show Registered Objects.

Sample Scripts and Scripting Tips
In this topic, you can find sample scripts that can be executed via the Scripting Window or used
in your user macros.
Tip: Other sample scripts are available in the Modeling community, Library section.

Reorder attributes/columns
Option 1:
Attributes.InitSort();
//set ordinal values as you need
var temp = Attr1.Ordinal;
Attr1.Ordinal = Attr2.Ordinal;
Attr2.Ordinal = temp;
Attributes.Sort(); //it will get ordered according to the ordinal
values set for individual items

Option 2:
Attributes.Move(2,0) //The first parameter is the Current
index in the list and the second is the index where an item
should move.

Refresh of Model Explorer and Workspace
RefreshAllWorkspaces

- Refreshes all Workspaces of currently active model.
RefreshWorkspace

Toad Data Modeler User Guide

544

Projects and Models

– Refreshes the selected Workspaces by ID.
RefreshModel

– Refreshes all Workspaces and also Model Explorer.

Add a Relationship and Key
//Create Relation with Shortcut on WS workspace
var Rel = Model.AddLink(2004,ParentEntShape.ID, ChildEntShape.ID, WS.ID);

OR
//Create Relation without Shortcut
Model.AddLinkObject(2004, ParentEnt, ChildEnt);

Add Columns to Keys
Key.AddAttribute(Attr)

– Adds an attribute to key.
Key.CommitChanges()

– Propagates the changes.

Possibility to Set User Rights
//SelectedObject - Every object that can have permission (Entity, Function,
Procedure etc.)
//User - User or User Group
Model.AddUserRight(SelectedObject, User, 'SELECT', 'Grant');

Accessing First Entity in First Model
function main()
{
   var app = System.GetInterface('Application');
   var Model = app.Models.GetObject(0); // first model in Application View
   var Entity = Model.Entities.GetObject(0); // first entity in a model
   ...
   ...

Toad Data Modeler User Guide

545

Projects and Models

}

Using Lock and Unlock Methods
It is good to use the Lock and Unlock methods, otherwise you will not see changes on your
Workspace directly. Use both methods to make safe modifications and refresh your WS
automatically.
function main()

   ...
   Entity.Lock();
   Entity.Name = "new_name";
   Entity.UnLock();
   ...
}

Accessing Log (Message Explorer)
Use the following to make Log accessible.
function main()
{
   ...
   Log = System.CreateObject('Log');
   ...
}

Iterating Entities and Modifying Second Parameter of Attribute
Data Type
This sample is for Oracle models only and changes the second parameter of Char(x) and
Varchar2(x) data types to BYTE.
function main()
{
  var app = System.GetInterface('Application');

Toad Data Modeler User Guide
Projects and Models

  var Model = app.Models.GetObject(0);
  var e, a, Entity, Attribute;
  Model.Lock();
  for (e=0; e<Model.Entities.Count; e++) // iterate entities
{
    Entity = Model.Entities.GetObject(e);
    Entity.Lock();
    for (a=0; a<Entity.Attributes.Count; a++) // iterate attributes
{
      Attribute = Entity.Attributes.GetObject(a);
      if ((Attribute.DataType.Caption == "Char(x)") ||
(Attribute.DataType.Caption == "Varchar2(x)"))
{
        Attribute.DataTypeParam2 = "BYTE";
      }
    }
    Entity.UnLock();
  }
  Model.UnLock();
}

Creating New Entities
function main()
{
  var app = System.GetInterface('Application');
  var Model = app.Models.GetObject(0);
  Model.Lock();
  var Entity = Model.CreateNewObject( 2002 );
  Entity.Name = 'MyNewEntity';
  Model.UnLock(); // Refresh all windows associated with your model
}

546

Toad Data Modeler User Guide

547

Projects and Models

Object type of PEREntity is 2002. More information can be found in the Reference document.
Click Help | Reference to open the Reference.

Converting Entity and Attribute Names to Lower Case
function main()
{
  var app = System.GetInterface('Application');
  var Model = app.Models.GetObject(0);

  for (e=0; e<Model.Entities.Count; e++)
{
    Entity = Model.Entities.GetObject(e);
    Entity.Lock();
    Entity.Name = Entity.Name.toLowerCase();
    Entity.UnLock();
    Log.Information("Name of entity "+Entity.Name+" was changed.");
    for (a=0; a<Entity.Attributes.Count; a++)
{
      Attribute = Entity.Attributes.GetObject(a);
      Attribute.Lock();
      Attribute.Name = Attribute.Name.toLowerCase();
      Attribute.UnLock();
      Log.Information("Name of attribute "+Attribute.Name+" in entity
"+Attribute.Owner.Name+" was changed.");
    }
  }
}

Note: The toLowerCase function is a JavaScript function.

Adding a Prefix to Entity, Index and Trigger Names
function main()

Toad Data Modeler User Guide

548

Projects and Models

{
  var prefix = "abc"; // defined prefix
  var regular_expression_prefix = new RegExp(prefix+"_");
  var app = System.GetInterface('Application');
  var Model = app.Models.GetObject(0);

  // Entities
  for (e=0; e<Model.Entities.Count; e++)
{
    Entity = Model.Entities.GetObject(e);
    if (Entity.Name.search(regular_expression_prefix) == -1) // if prefix is
not used in name
{
      Entity.Lock();
      Entity.Name = prefix+"_"+Entity.Name;
      Entity.UnLock();
      Log.Information("Name of entity "+Entity.Name+" was changed.");
    }

    // Indexes
    for (i=0; i<Entity.Indexes.Count; i++)
{
      Index = Entity.Indexes.GetObject(i);
      if (Index.Name.search(regular_expression_prefix) == -1) //if prefix is
not used in name
{
        Index.Lock();
        Index.Name = prefix+"_"+Index.Name;
        Index.UnLock();
        Log.Information("Name of index "+Index.Name+" in entity
"+Index.Owner.Name+" was changed.");
      }

Toad Data Modeler User Guide

549

Projects and Models

    }

    // Triggers
    for (t=0; t<Entity.Triggers.Count; t++)
{
      Trigger = Entity.Triggers.GetObject(t);
      if (Trigger.Name.search(regular_expression_prefix) == -1) //if prefix
is not used in name
{
        Trigger.Lock();
        Trigger.Name = prefix+"_"+Trigger.Name;
        Trigger.UnLock();
        Log.Information("Name of trigger "+Trigger.Name+" in entity
"+Index.Owner.Name+" was changed.");
      }
    }
  }
}

Renaming NotNull Constraints
The script is for Oracle models only. It goes through all NotNull attributes and sets their notnull
constraint name in format NN_nameoftable_number. For names exceeding 30 characters, it will
truncate the NN_nameoftable part.
function main()
{
  var app = System.GetInterface('Application');
  var Model = app.Models.GetObject(0);

  for (e=0; e<Model.Entities.Count; e++)
{
    Entity = Model.Entities.GetObject(e);
    count = 0;

Toad Data Modeler User Guide

550

Projects and Models

    for (a=0; a<Entity.Attributes.Count; a++)
{
      Attribute = Entity.Attributes.GetObject(a);
      count++;
      if (Attribute.NotNull)
{
        ConstraintNotNullName = "NN_" + Entity.Name;
        SumLength = ConstraintNotNullName.length + 1 + count.toString
().length;
        if (SumLength > 30)
          ConstraintNotNullName = ConstraintNotNullName.substr(0,30(count+1));
        ConstraintNotNullName = ConstraintNotNullName + "_" +
count.toString();
        Attribute.ConstraintNotNullName = ConstraintNotNullName; // change
name of index
        Log.Information("NotNull Constraint Name of attribute
"+Attribute.Name+" in entity "+Attribute.Owner.Name+" was changed.");
      }
    }
  }
}

Selecting Override Identity Checkboxes at Once
This script is valid for MS SQL Server 2000 and MS SQL Server 2005 models only.
You can use the script provided that you set autoincrement in a domain, use the domain in PK
attribute and create relationship to another entity. In this case, FK attribute with the domain
(and identity) will be created in child entity. However, you need to override the identity. Not
to do it for each FK attribute individually, you can run this script that goes through all FK
attributes and automatically selects the checkbox Override Identity. After you execute the
script, take a look at the Log window where all entities and attributes where the checkbox was
selected is written out.
function main()
{
  var app = System.GetInterface('Application');

Toad Data Modeler User Guide

551

Projects and Models

  var Model = app.Models.GetObject(0);
  for (e=0; e<Model.Entities.count; e++)
{
    Entity = Model.Entities.GetObject(e);
    for (a=0; a<Entity.Attributes.count; a++)
{
      Attr = Entity.Attributes.GetObject(a);
      for (i=0; i<Attr.PKForeignKeys.count; i++)
{
        PKAttr = Attr.PKForeignKeys.GetObject(i).AttrParent;
        FKAttr = Attr.PKForeignKeys.GetObject(i).AttrChild;
        if (PKAttr.Domain != null)
{
          if (PKAttr.Domain.Identity)
{
            Log.Information(FKAttr.Owner.Name+"."+FKAttr.Name);
            FKAttr.Identity_override = true;
          }
        }
      }
    }
  }
}

Customization - Sample
Expert Mode
Before you start customizing the application, you need to enable the Expert Mode option in
Toad Data Modeler.
After the Expert Mode is turned on, particular functions and options, hidden so far in Toad Data
Modeler, will become available.
1. Select the Settings menu | Options | General | Expert Mode.

Toad Data Modeler User Guide
Projects and Models

2. New section Expert Mode appears in Options.

3. The following functions/options become available:

552

Toad Data Modeler User Guide

553

Projects and Models

Plus options for defining, loading and storing Object Types and Properties (OTPs)
in various forms and dialogs. More details on OTPs can be found in the Help file,
"OTPs" topic.
4. In this scenario, after you select the Expert Mode checkbox, take notice of the new
Expert Mode item in the Options dialog (above General). Here, you can see this option Save the definitions to the 'My Package'. Clear this checkbox.
Notes:
l

If you wanted to save all changes you made in the application (e.g.
while customizing a form) to My Package, you would leave this
checkbox selected.

l

If you wanted to save the changes you made to another package (e.g. new
add-on package that you created), you would clear this checkbox. - This is
what we will do in our Customization Sample. Follow the next topics.

Related Topics
Our Goal (page 554)

Toad Data Modeler User Guide

554

Projects and Models

Script and Package Explorers
Script Explorer
In Script Explorer, you can edit existing scripts, extend functionality of existing scripts, create
your own scripts etc.
Package Explorer
Package Explorer displays structure of packages in Toad Data Modeler. Here, you can work with
objects saved in the packages - rename them, move, copy etc. You can also access all Meta
Models from the Package Explorer.
For more details, please see the Help file, "Scripting and Customization" chapter.

Our Goal
The following tutorial guides you through some of the customization options available in Toad
Data Modeler.
Read the goal definition below and go step by step to accomplish it (see the topics one by one
in this section).
During your work, you will use various tools (e.g. Package or Script Explorer etc.) and
features (e.g. form editing or setting default values etc.). To follow the point of the example
fluently and clearly without digressions, details on these features (their functionality and
options) are not described. For more information on them, please see the appropriate
topics/chapters in the Help file.
Our Goal Definition:
l

To be able to mark an entity as "Confirmed" By Customer.

l

To be able to write Customer Notes to entity, but don't mix them with Comments or
Notes in Toad Data Modeler. Customer notes and developer notes must be differentiated.

l

Define both values in the Entity Properties form, if possible.

l

Store both values in a model.

l

Write a list of Confirmed and Not Confirmed entities to Message Explorer (Log). Just to
get a quick overview.

l

Generate modified HTML reports with both the entity status and notes from customer.

l

All for Oracle 10g only. Other models for other databases must remain untouched.

Think about how you could achieve this task in another application (Toad Data Modeler or any
other modeling tool), and then read the rest of this section to find out how easily you can
achieve this in Toad Data Modeler.

Toad Data Modeler User Guide

555

Projects and Models

Before you start, see the following two screenshots for an inspiration:
1. There is no Customer Feedback tab in any standard Entity Properties form. This tab has
been added to the form by end-user - by YOU!

2. In generated HTML reports, there is no section Customer Feedback. As you can see
below, users may use the values defined on modified forms, and generate modified HTML
reports. The section Customer Feedback has been added to the reports by end-user - by
YOU! (And generated automatically, of course.)

Toad Data Modeler User Guide

556

Projects and Models

Related Topics
Create Package (page 556)
Create Package
Why Do We Need a New Package?
Packages are containers for groups of scripts, customized Form definitions, metamodels etc. In
Toad Data Modeler, the following three types of packages may exist.
l

System packages - have the lowest priority (distributed with Toad Data Modeler
application).

l

Add-on packages - have higher priority than system packages (can be downloaded from
web site, shared among users etc. No add-on package exists after installation.).

l

My Package - has the highest priority (created automatically upon installation of Toad
Data Modeler).

All the packages exist as separate XML files with extension .TXG.
You can make your modification without the necessity to create a new package, but all scripts
and modifications you will ever make will be stored in the My Package.txg file. If you plan to
share your modifications with others, it's a good idea to create a new package for this purpose. In
this example, we will create a new package CustomerFeedback, and store all scripts used in this
tutorial, metamodel and form modifications into this package. It will give us the possibility to
share the CustomerFeedback.txg file with others.

Toad Data Modeler User Guide

557

Projects and Models

Create a New Package
Click Expert Mode| Customization | New Package or activate Package Explorer and click the
New Custom Package icon.

Define Name of the package.

Toad Data Modeler User Guide

558

Projects and Models

Select packages on which the new package depends. In this example, the Customer Feedback
will not be dependent package. It will just extend existing packages.
Note: Example of dependent package: Package RE MS SQL Server 2005 depends on RE MS
SQL Server package and extends MS SQL Server 2005 package. (RE is abbreviation for
Reverse Engineering.)
Select packages you want to extend. In our example, we will be extending Database Oracle 10g
package and HTML Reports for Oracle 10g.
You can write description to the Description tab.
Newly created package will appear in the Package Explorer. You can also see package
extensions there. Custom packages have blue icon.

Toad Data Modeler User Guide

559

Projects and Models

Just to compare, see My Package (where all modifications are stored if you don't use add-on
packages) - it has a green icon and is listed at the top.
Well, a new package exists, let's continue adding new properties.

Related Topics
Add New Properties in Metamodel (page 559)
Add New Properties in Metamodel
Properties and methods can be added visually, via Metamodel.
For our purpose, we will need two new properties.
l

ConfirmedByCustomer (boolean)

l

NotesFromCustomer (string)

This is where our values will be stored. The properties will be assigned to items that will appear
in Entity Properties form. The ConfirmedByCustomer property value will be assigned to a
checkbox, and the NotesFromCustomer value will be assigned to a text box.
How To Add New Properties
Right-click the CustomerFeedback package and select Open Metamodel.

Toad Data Modeler User Guide

560

Projects and Models

Empty metamodel digram opens.
Right-click the workspace and select Add Class...

Select class you want to extend. For our purpose, we need to extend PEREntityOR10 class.
PER - Physical Entity Relationship model.
Entity - Items must be accessible in the Entity Properties form.
OR10 - Modification will be made for Oracle 10g only.
Select the newly added class and right-click it. Select Edit.

Toad Data Modeler User Guide

561

Projects and Models

Add two new properties to the class.
ConfirmedByCustomer, data type Boolean.
On tab Attributes of the Property Properties dialog, you can define property Attributes. Select
Editable (we need to be able to edit the values) and Store Property (we want to store the values
with model).
Now define the second Property NotesFromCustomer, on tab Attributes, select the same
attributes - Editable and Store Property.

Toad Data Modeler User Guide

562

Projects and Models

Properties have been added to the metamodel. Now it's necessary to save the metamodel and
restart the application. Then we can continue modifying Entity Properties form.
Note: Metamodels are XML documents stored as .TXM files.

Related Topics
Modify Form (page 562)
Modify Form
Back to our Oracle 10 physical model.
Edit an entity to open standard Entity Properties form.
Right-click the form and select Customize Form as...

Toad Data Modeler User Guide
Projects and Models

Select a package you want to store modifications in.

The following forms and palettes will appear. Note that the Entity Properties form has
dotted grid now.
In the Form Explorer, see that the form name is FmPEREntityEdit. We will need this
information later.
To add a new tab to the Entity form, right-click any tab in the form and select New Page.

Define Caption for the new tab in Component Inspector.
Then select DataCheckBox item from the Component Palette.

563

Toad Data Modeler User Guide

564

Projects and Models

And add a new checkbox to the CustomerFeedback tab.
Select the Entity item from DataSource field in the Component Inspector.
Then select ConfirmedByCustomer item from DataField.
Select DataMemo from Component Palette and add new text field (datamemo) item to the
Customer Feedback tab.
Result:

Close the Entity Properties form by clicking the red X button at top of the form. Component
Inspector, Component palette, Form Explorer will disappear.
Then right-click the form and select Save Form to CustomerFeedback.

Toad Data Modeler User Guide

565

Projects and Models

New items are in the form.

Related Topics
Set Default Values (page 565)
Set Default Values
How to Define Default Values
If you need to change the default value for new items, do the following:
Right-click the form (Entity Properties form in our example) and select Default Values
for Class.

Toad Data Modeler User Guide
Projects and Models

We want the Confirmed by customer checkbox to be selected by default for new entities.
Select property name and click the Default Value column. Then press F2 to edit the value.
Select where the definition will be stored. In our example, we need to store it into the
CustomerFeedback package.
Click the dialog to confirm your selection in combo box and then confirm OK.
Done.

Related Topics
Add Events (page 566)
Add Events
The following events are available in Toad Data Modeler scripting:
l

OnCreate

l

OnCheck

l

OnChange

l

OnClick

l

OnClickSilent

l

OnClose

566

Toad Data Modeler User Guide

567

Projects and Models

Let's add OnCheck event to the checkbox on the Customer Feedback tab of the Entity
Properties dialog. When the checkbox is selected, the text box with Notes from Customer will
be visible. When the checkbox is clear, the text box will disappear.
In Package Explorer, select the Script folder under the CustomerFeedback package. Right-click it
and select AddScript.
Set the script name to FmPEREntityEdit. - This is the name of the form we want to write the
script for. See the "Modifying a Form" topic to find out where the form name is defined.

Set visibility to Oracle 10g only.

Toad Data Modeler User Guide
Projects and Models

Close the window, right-click the script again and select Edit Source Code.
Add there the event function.

568

Toad Data Modeler User Guide

569

Projects and Models

Code:
function DataCheckBox1OnCheck()
{
if(DataCheckBox1.Checked == true)
DataMemo1.Visible = true;
else
DataMemo1.Visible = false;
}

Explanation of items in bold.
DataCheckBox1OnCheck()
l

DataCheckBox1 - name of item that has been added to the Entity form.

l

OnCheck - name of event.

DatacheckBox1 and DataMemo1
l

Both are names of items that were added to the Entity form. See "Modify Form" (page
562) for more information.

Press Commit to confirm the script.
Result:
When the checkbox is clear, the text area is hidden.

Toad Data Modeler User Guide
Projects and Models

If you select the checkbox, the text area will display.

570

Toad Data Modeler User Guide

571

Projects and Models

Related Topics
Access Property Values via Scripting Window (page 571)
Access Property Values via Scripting Window
You can write scripts inToad Data Modeler , save the scripts to packages, distribute the packages
etc. - This will be explained later. Now you will see how to work with Scripting Window that
allows you to run scripts at once, without the necessity to have them stored in packages.
Click Expert Mode | Scripting Window to open it. (Of course, Expert Mode has to be
turned on.)
The following dialog appears. If you don't see the upper part of the Scripting Window, select
View | Show Registered Objects.
On the left, you can see available models. Use the arrows to select model you want to work
with. In our example, we will execute script for Videorental model (for Oracle 10g).
In the Name in Script column, you can define name that will be used in the script. Our
OrigModel value will represent the selected Videorental model.

Write script to the main() function.

Toad Data Modeler User Guide

572

Projects and Models

Code:
function main(){

var i, e;
var Ent;
var EntListConfirmed = new Array();
var EntListNotConfirmed = new Array();

// iterate through entities and check the value of ConfirmedByCustomer
property
for (i=0; i<OrigModel.Entities.Count; i++)
{

Ent = OrigModel.Entities.GetObject(i);
if(Ent.ConfirmedByCustomer == true)
EntListConfirmed[EntListConfirmed.length] = Ent.Name; // add to list of
confirmed entities

Toad Data Modeler User Guide

573

Projects and Models

else
EntListNotConfirmed[EntListNotConfirmed.length] = Ent.Name; // add to list
of not confirmed entities
}

// write list of confirmed entities to Log.
Log.Information ("--------------------------------------");
Log.Information ("List of entities confirmed by customer");
Log.Information ("--------------------------------------");
for (e=0; e<EntListConfirmed.length; e++)
{
Log.Information(EntListConfirmed[e]);
}
Log.Information ("# Number of confirmed entities:
"+EntListConfirmed.length.toString());

// write list of NOT confirmed entities to Log.
Log.Information ("--------------------------------------");
Log.Information ("List of entities NOT confirmed by customer");
Log.Information ("--------------------------------------");
for (e=0; e<EntListNotConfirmed.length; e++)
{
Log.Information(EntListNotConfirmed[e]);
}
Log.Information ("# Number of NOT confirmed entities:
"+EntListNotConfirmed.length.toString());

}

Toad Data Modeler User Guide

574

Projects and Models

Where to find information about objects and their properties and
methods?
Explanation of Items in Bold:
OrigModel.Entities.Count
l

OrigModel - represents object assigned in the upper part of the Scripting
Window (Videorental object renamed to OrigModel).

l

Entities - we work with Physical Entity Relationship model, therefore we need to search
for PER object. Model is for Oracle 10g, let's find the PERModelOR10 object in the
Reference.

l

Count - represents a feature that is available for all List objects. On the screenshot above,
you can see that the Entities datatype is a List. Let's click the List link and see details of
the List class.

Toad Data Modeler User Guide

575

Projects and Models

OrigModel.Entities.GetObject(i)
l

GetObject - belongs to the List class.

Ent.ConfirmedByCustomer
l

Ent - is a variable that holds assigned Entity objects (assigned earlier using the
OrigModel.Entities.GetObject(i)function).

l

ConfirmedByCustomer - property of PEREntityOR10 object, added to Metamodel

of the CustomerFeedback package.

Ent.Name
l

Ent - is a variable that holds assigned Entity objects (assigned earlier using the
OrigModel.Entities.GetObject(i)function).

l

Name - property of PEREntityOR10 object. We still work with PER model and now we
need to find property of Entity in Oracle 10g model. Let's see properties of the
PEREntityOR10 object.

Toad Data Modeler User Guide

576

Projects and Models

.length and .toString()
l

both are standard JavaScript items.

Executing the Script
Click Execute Script

Related Topics
Create Script (page 577)

. Result will be displayed in the Message Explorer and Log area.

Toad Data Modeler User Guide

577

Projects and Models

Create Script
You know how to execute scripts from the Scripting Window. If you want to store the script and
call it from another form in the application, for example, do the following:
Create a new script WriteFeedbackToLog. See the "Adding Events" topic to find out how to
create new scripts.

Write there function WriteFeedback.

Toad Data Modeler User Guide

578

Projects and Models

Code
function WriteFeedback ()
{
var Log = System.CreateObject('Log');
var Application = System.GetInterface('Application');
var OrigModel;
OrigModel = Application.Models.GetObjectByID(Model.ID);
....
....
}

Explanation
The WriteFeedback function is almost identical to the Main function we were executing from the
Scripting Window.
The only difference is in the definition of OrigModel object. In the Scripting Window, we could
select Videorental and define the OrigName name.
However, now we have no means to select the object visually (and we do not need it, the
function will be executed for active model). Therefore we need to define the OrigModel object
via Application.Models.GetObjectByID method, with parameter Model.ID.
This way we can get the currently active model.
We also need to register object Log. (It is not necessary to register Log in the Scripting Window.
Log is registered in the Scripting Window automatically.)
The rest of the script is identical.

Toad Data Modeler User Guide

579

Projects and Models

Related Topics
Call Existing Script from Model Properties Form (page 579)
Call Existing Script from Model Properties Form
Edit the Model Properties form. See the "Modify Form" topic to find out how to edit
existing form.
Add there a new button and remember the name of the form - FmPERModelEdit. The name can
be found in the Form Explorer.
Defined caption for the button - Write Customer Feedback To Log.
Set the name of the button to FeedbackButton.
Create a new script with the name of the Model Properties form - FmPERModelEdit.
Write event function to the script.
Code
function FeedbackButtonOnClick()
{
WriteFeedbackToLog.WriteFeedback()
}

Explanation
l

FeedbackButton = name of the button.

l

OnClick = event.

l

WriteFeedbackToLog = name of script that contains called function.

l

WriteFeedback = called function.

When you click the button, an output will be displayed in Message Explorer (Log).

Related Topics
Modify HTML Reports (page 579)
Modify HTML Reports
To modify HTML reports, we need to extend existing method. The first thing we need to do is to
find out what script should be extended.

Toad Data Modeler User Guide

580

Projects and Models

In Script Explorer, you can see BasicHTMLPERReportOR script with function
ReportTableUserProperties. This is the script that generates Tables pages in HTML reports,
specifically the section Table Properties.

You can also see script BasicHTMLPERReportOR10 that extends the
BasicHTMLPERReportOR script.
Now we now need to write a script that will extend the ReportTableUserProperties function
defined in the BasicHTMLPERReportOR script.
For that purpose, we need to open our CustomerFeedback metamodel and the method there.
Open the CustomerFeedback metamodel, add there a new class (see the Class icon in the
toolbar), edit the class and set the name to BasicHTMLPERReportOR10. (One extension of
that class already exists, in our metamodel we will create another extension of the class).
Define Object Type (the value can be currently found out in metamodel to HTML report for
Oracle 10g package).

Toad Data Modeler User Guide

581

Projects and Models

Add the ReportTableUserProperties method to the class.
Add two new parameters to the method. (The method name and number of parameters must be
identical to the original method - see the first screenshot).

Toad Data Modeler User Guide

582

Projects and Models

Return back to the General tab. Click Reload. Script name and method name will appear there.
Add a prefix My to it (this will be changed in future, no manual modification will be required).

Toad Data Modeler User Guide

583

Projects and Models

Click Edit Script.
Click OK and define code for the ReportTableUserProperties method that extends the existing
method of the same name.

Toad Data Modeler User Guide
Projects and Models

Code:
function ReportTableUserProperties(Document, Entity)
{  
 

// Table definition
Table = Document.CreateTable(false,true);
Table.CreateColumn(20);
Table.CreateColumn(80);
var row = -1;

if (Entity.ConfirmedByCustomer == true)
{  
 
Table.CreateCell(  
 
++row,0,'Confirmed' );
Table.CreateCell(  
 
row,1,'Yes' );
}
else if (Entity.ConfirmedByCustomer == false)
{  
 
Table.CreateCell(  
 
++row,0,'Confirmed' );
Table.CreateCell(  
 
row,1,'No' );
}

584

Toad Data Modeler User Guide

585

Projects and Models

else
{  
 
Table.CreateCell(  
 
++row,0,'Confirmed' );
Table.CreateCell(  
 
row,1,'Undefined' );
}

if (Entity.NotesFromCustomer.length > 0)
{  
 
Table.CreateCell(  
 
++row,0,'Notes from Customer' );
Table.CreateCell(  
 
row,1, Entity.NotesFromCustomer );
}

if (row > -1)
{
Document.WriteStyled(  
 
'CAPTION2', 'Customer Feedback' );
Table.Draw();
Table.Close();
}

Instance.ReportTableUserProperties(Document, Entity);

};

Explanation
Table.CreateColumn(20) - the CreateColumn function belongs to the

HTMLReportTable class. All functions related to the Table object can be found in the
Toad Data Modeler Reference.
Entity.ConfirmedByCustomer - represents the variable we added earlier to the

CustomerFeedback metamodel.
Entity.NotesFromCustomer.length - standard JavaScript function that returns number of

characters of the NotesFromCustomer string.

Toad Data Modeler User Guide

586

Projects and Models

Document.WriteStyled - represents function that belongs to the HTMLDocument class.
Instance.ReportTableUserProperties(Document, Entity);
l

Instance - using the Instance keyword, we can call existing function we extended. We
could copy and paste the content of the ReportTableUserProperties function defined in
the BasicHTMLPERReportOR script. However, if a change was made to the script later,
we would have to update our script too, which would be difficult to maintain. That's why
it's better to write code that will extend the existing functionality only, and call the rest
from existing script via the Instance keyword.

l

ReportTableUserProperties - represents existing function we call.

When you generate HTML reports now, you will see the following output. New section
Customer Feedback is generated on top, followed by the Table Properties part, as originally
defined in the ReportTableUserProperties function in script BasicHTMLPERReportOR.

Customize Forms and Frames
Editable Forms and Frames
Toad Data Modeler allows you to edit some forms and frames for more comfortable work.
Note: This option is available only if Expert Mode is enabled.
What Is Editable Form?
It is a form of which appearance you can edit to meet your needs and requirements. You can add,
change components and delete user components (those you created).

Toad Data Modeler User Guide

587

Projects and Models

How Do I know the Form is Editable?
Right-click the form to see the pop-up menu. If there's the Customize Form (as) option, the form
is editable.
Example: The Entity Properties form

What Is Editable Frame?
Properties of editable frames are similar to properties of editable forms, however frame represents
only a part of a form, not complete form. E.g. the Options form has editable frames Application,
Graphics etc.
What Is Editable Form for?
To customize appearance and functionality of forms to suit your needs, e.g. you want to have
different options for different database types.
If you model your own property in metamodel, you will probably want to visualize it somehow
(write out its value to edit etc.) Therefore it's necessary to edit appropriate form and insert to it a
new component to which you will assign appropriate property then. Also, to inserted
components, you can add values by scripting.
To edit a form
»

Right-click the form and select Customize Form or CustomizeForm as.

Customize
Form

The changes will be saved to your user package My
Package.

Customize
Form as

The changes will be saved to another package than My
Package. This option is disabled by default. To enable it,
select Settings | Options | Expert Mode and clear the
Save the definitions to the My Package checkbox.

Forms can be edited via the following tools :

Toad Data Modeler User Guide

588

Projects and Models

l

Component Inspector - list of properties of selected component in the form. Here, you can
edit properties

l

Component Palette - list of components that you can add to a form

l

Form Explorer - tree structure of the edited form

l

Alignment - alignment options

Forms of these three tools can be docked in Toad Data Modeler environment at your
convenience.
If you want to hide/show any of these tools permanently, you can clear/select
appropriate option in:
l

Right-click the form and select Designer Mode Options.

l

From the Settings menu, select Options | Editable Forms.

Example: The Entity Properties form that is being edited now.

To finish editing a form
»

Close the form that you have just edited (click x in the right-hand corner, e.g. in the
Entity Properties form).

After you close the edited form, you need to save the changes to package.
Note: You will not finish editing the form by closing any of the tool forms (Inspector, Explorer
or Palette Component). If you close any of them, the Show option for the tool (Show Inspector,
Show Explorer...) will be automatically cleared. If you edit a form next time, the form of this tool
will not display. To display it again, you need to enable the Show option either in the Designer
Mode Options or in the Settings menu | Options | Editable Forms.

Toad Data Modeler User Guide

589

Projects and Models

To save the changes
1. Right-click the form and select Save Form or Save Form to.
The changes will be saved to appropriate packages, however to preserve them even after
you close the application, you have to save also the packages.
2. Save the packages in Package Explorer.
Changes will be saved either to actual package, or user package (according to the settings in the
Settings menu | Options | Paths).
If you want to save the changes to another package, you have to start the edit process
with option Edit Form as, then select the package and finally click Save Form to to save
the changes.

Editable Forms Right-Click Options
Right-click the form to see the following options:
Option

Description

Customize
Form

Edits a form. All changes will be stored to My
Package user package (file My Package.txg).

Customize
Form as

Edits a form in a state according to the selected
package. (Only the components that are saved in the
selected package and its child packages will be
available.)
This option is available only if checkbox Save the
Definitions to the 'My Package' is clear. - See the
checkbox in the Settings menu | Options | Expert
Mode.

Load Form

Reloads a form.

Save Form

Saves changes in the default package (see the Settings
menu).

Save Form to

Saves changes to previously selected package (see
Edit Form as).

Designer Mode
Options

Here, you can hide/show the tools for next form edit.

Default Values
of Object

Opens the dialog where you can define or edit default
values of appropriate form/dialog/frame.

Toad Data Modeler User Guide

590

Projects and Models

Note: To see how this function works, please read User Guide, "Customization Sample" chapter.

Related Topics
Component Inspector (page 590)
Component Palette (page 591)
Form Explorer (page 592)
Component Inspector
Component Inspector is a list of properties of the selected component in the form. Here, you can
edit properties.

Toad Data Modeler User Guide

591

Projects and Models

Option

Description

Top
combo-box

Select a component to display in this dialog.

Left
Column

Displays property names.

Right
Column

Displays values. Most of the values can be changed in
inplace editors.

Note: If you select components directly in the form you edit, you can
select more components using the SHIFT key. Then, only common
properties will be displayed in Component Inspector.
Right-click the Component Inspector form and select Properties.
Here you can edit colors of particular parts of the dialog, and select other options.

Component Palette
Component Palette is a list of components that you can add to a form. It is divided
into two parts:
l

Data - here you can find components that can follow up with already existing properties

l

Standard - other components that can be used for change of appearance or better
classification of components

To insert a component to a form
1. Select a component from the Component Palette.
2. Click to a place where you want to insert it.
Note: For multiple addition of a component, press SHIFT when you select it from the
Component Palette.

Toad Data Modeler User Guide

592

Projects and Models

To display components with small buttons
»

Right-click the Component Palette form and select Properties | Small Buttons.

Form Explorer
Form Explorer displays tree structure of components in a form.
In Form Explorer, you can move components, select them for edit in Component Inspector (via
mouse), and delete them (Delete key).

Toad Data Modeler User Guide

593

Projects and Models

Right-click the Explorer form and select Properties:

Macros
Macros
Toad Data Modeler supports macros. You can use sample macros available in the Macros menu
or create your own macros. You can create a macro in Package Explorer or Script Explorer and
modify its properties to display the macro either in the main menu or pop-up menu (of particular
object or on the Workspace etc.). Visual components for creation of macros are also available
(User Forms).
To see or use the available sample macros
»

Select Macros | All.

Sample macros:

Toad Data Modeler User Guide

594

Projects and Models

l

Convert Names to Lower Case

l

Convert Names to Upper Case

l

Infer Relationship - Macro for automatic creation of relationships between identically
named columns.

l

Alphabetic Autolayout - See "Autolayout" (page 333) for more information.

The selected macro will be applied on all objects on all Workspaces of the model or all objects
of the active Workspace.
»

Select Macros | Selected Objects.

Sample macros:
l

Remove Spaces from Names

l

Display Entities Note on Workspace

l

Infer Relationships on Selected Entities

The selected macro will be applied only on the selected objects on the currently active
Workspace.
»

Select Macros | Productivity to access macros from Productivity Pack

»

Select Macros | Rename to access macros from Rename Objects Pack

Scenario
You want to create a macro Add Attribute to PK and add this macro to
pop-up menu of attributes in Model Explorer.

Toad Data Modeler User Guide
Projects and Models

To create your own macro
1. Open Script Explorer (Tools menu, Expert mode must be enabled).
2. Right-click the Macros item and select Add New Macro.

3. Right-click the newly created macro and select Properties.

595

Toad Data Modeler User Guide

596

Projects and Models

4. Define properties of the new macro. Remember to define its caption (macro name
that will be displayed), visibility on tab Visibility (if for all databases etc.).

Toad Data Modeler User Guide

597

Projects and Models

5. On tab Others, you can define Undo options. It is recommended to keep the
default settings.

6. On tab Menu, you can define where you want to display the macro - in Main menu, popup menu or both.

Toad Data Modeler User Guide

598

Projects and Models

Select Add to Popup Menuand write the path name.

7. On tab Object Types, select object types for which the macro will be available in their
pop-up menu.

Toad Data Modeler User Guide
Projects and Models

Select Attribute and confirm OK.

599

Toad Data Modeler User Guide

600

Projects and Models

8. Double-click the new macro to open the Script Editor. Modify the default code
at your convenience.

9. Confirm Commit and Save.
10. The Macros will be available accordingly.

Related Topics
Script Explorer (page 531)
Script Editor (page 535)

Toad Data Modeler User Guide

601

Projects and Models

Macros and User Forms
Toad Data Modeler allows you to create a macro in Package Explorer or Script Explorer and
modify its properties to display the macro either in main menu or pop-up menu (of particular
object or on the Workspace etc.).
Older versions allowed you to define such macros via a script written in Script Editor. To
execute the script directly, you simply selected the macro in the particular menu.
Toad Data Modeler version 3.5 is bringing some improvements for using macros - visual
components for macros (User Forms). So, now when you select a macro, a user form can display.

User Forms - Brief Information:
l

You can create and use user forms to interact with Toad Data Modeler during script and
macro execution. You can enter input parameters or see some output information.

l

Function Main only creates and displays the user form. Other functionalities must be
implemented/added via form events or its controls. So, a form is not a dialog.

Create a Form
To create a form, use the object System that is registered in every script.
The method you need is called CreateForm and has four optional parameters:
Example:
var form = System.CreateForm(‘FormName’, ‘Form Caption’, 200, 150);
1. First Parameter – Name of form (it mustn’t contain spaces and other invalid/not permitted
characters).
2. Second Parameter – Caption that will be displayed in the heading of the form.
3. Third Parameter – Width of the form.
4. Fourth Parameter – Height of the form.
Functions of Form
AddControl(ControlName: widestring, ControlType: Integer): IDispatch;
l

ControlName – Name under which the control is accessible.

l

ControlType – Number of control type that should be created.

See the following table:
-1

- Edit Box

Toad Data Modeler User Guide

602

Projects and Models

-2

- Check Box

-3

- Memo

-4

- Panel

-5

- Label

-6

- Group Box

-7

- Radio Button

-8

- Combo Box

-9

- List Box

- 10

- Button

This function adds control on the form.
ShowModal()
This function displays the form.
Procedures of Form
AddUserVariable(AName: widestring, DefaultValue)
l

AName – Name under which a variable is accessible in events of forms.

l

DefaultValue – Default value. It can be of types integer, widestring or boolean.

This procedure adds a variable on the form. The variable is then accessible in events via calling
the Instance.VariableName. The variable is accessible across events. If you change a content of
the variable in one event, the changed status will be accessible in another event.
RegisterObject(AName: widestring, AObject: IDispatch)
l

AName – Name of object via which it will be accessible in events.

l

Aobject – Object that is registered.

Use this procedure to register objects in events.
Properties of Form
Caption – Heading of the form.
CloseAfterExecute – True – When you click Execute, the code will be executed and the form
closed. False – The form will not close after execution. False is set up by default.

Toad Data Modeler User Guide

603

Projects and Models

ExecuteMethodName – Name of method that should be executed when you press the
Execute button.
ExecuteScriptName – Name of script for calling out the method when you click the
Execute button.
Note: If you don’t want to use the button Execute, do not set up the properties
ExecuteMethodName and ExecuteScriptName. The button will not be visible on the form then.

EVENTS
To assign events, assign the component of particular event to properties of names
NameEventScriptName, NameEventMethodName with reference to particular service method.
Example:
Button.OnClickScriptName = ‘MyScript’;
Button.OnClickMethodName = ‘DoOnClick’;

CONTROL
Control is an ancestor from which all controls, including the form, inherit.
Properties of Control
Align – Alignment of control. Possible values to use:
0 - No alignment
1 - Alignment - Top
2 - Alignment - Bottom
3 - Alignment - Left
4 - Alignment - Right
5 - Alignment – Justify
AnchorTop, AnchorBottom, AnchorLeft, AnchorRight – Determines the position of control.
Default place – top left-hand corner.
Parent – Control on which a control is placed. Default position of all controls is on the form and
this property is not set up.
Note: Description of value Align 0..5:
alNone - The control remains where it was placed. This is the default value.

Toad Data Modeler User Guide

604

Projects and Models

alTop - The control moves to the top of its parent and resizes to fill the width of its parent. The
height of the control is not affected.
alBottom - The control moves to the bottom of its parent and resizes to fill the width of its
parent. The height of the control is not affected.
alLeft - The control moves to the left side of its parent and resizes to fill the height of its parent.
The width of the control is not affected.
alRight - The control moves to the right side of its parent and resizes to fill the height of its
parent. The width of the control is not affected.
alClient - The control resizes to fill the client area of its parent. If another control already
occupies part of the client area, the control resizes to fit within the remaining client area.

BUTTON
Event
OnClick – Occurs when you click the button.
CHECKBOX
Event
OnClick – Occurs when the check in checkbox is changed.
COMBO-BOX
Event
OnSelect - Occurs when combo box is selected.
EDIT
Event
OnChangeText – Occurs when text in edit box is changed.
MEMO
Event
OnChangeText – Occurs when text in memo is changed.

Toad Data Modeler User Guide

605

Projects and Models

RADIO BUTTON
Event
OnClick – Occurs when the button is selected.
For more properties, please read the Reference Guide (Help menu | Reference, Expert mode must
be selected). See objects: UserButton, IUserCheckBox, IUserComboBox, UserControl, UserEdit,
UserFormBasic, UserForm, UserGroupBox, IUserLabel, UserListBox, UserMemo, IUserPanel,
UserRadioButton, UserStrings.

Related Topics
MacrosMacrosToad Data Modeler supports macros. You can use sample macros available in the
Macros menu or create your own macros. You can create a macro in Package Explorer or Script
Explorer and modify its properties to display the macro either in the main menu or pop-up menu
(of particular object or on the Workspace etc.). Visual components for creation of macros are also
available (User Forms).To see or use the available sample macrosSelect Macros | All.Sample
macros:Convert Names to Lower CaseConvert Names to Upper CaseInfer Relationship - Macro
for automatic creation of relationships between identically named columns.Alphabetic
Autolayout - See "Autolayout" (page 1) for more information.The selected macro will be applied
on all objects on all Workspaces of the model or all objects of the active Workspace. Select
Macros | Selected Objects. Sample macros:Remove Spaces from NamesDisplay Entities Note on
WorkspaceInfer Relationships on Selected EntitiesThe selected macro will be applied only on
the selected objects on the currently active Workspace.Select Macros | Productivity to access
macros from Productivity PackSelect Macros | Rename to access macros from Rename Objects
PackScenarioYou want to create a macro Add Attribute to PK and add this macro to pop-up
menu of attributes in Model Explorer.To create your own macroOpen Script Explorer (Tools
menu, Expert mode must be enabled).Right-click the Macros item and select Add New
Macro.Right-click the newly created macro and select Properties.Define properties of the new
macro. Remember to define its caption (macro name that will be displayed), visibility on tab
Visibility (if for all databases etc.).On tab Others, you can define Undo options. It is
recommended to keep the default settings.On tab Menu, you can define where you want to
display the macro - in Main menu, pop-up menu or both.Select Add to Popup Menuand write the
path name.On tab Object Types, select object types for which the macro will be available in
their pop-up menu. Select Attribute and confirm OK.Double-click the new macro to open the
Script Editor. Modify the default code at your convenience.Confirm Commit and Save.The
Macros will be available accordingly.   Related TopicsScript Explorer (page 1)Script Editor (page
1) (page 1)
Macro and User Forms - Use Case (page 605)
Macro and User Forms - Use Case

Scenario

Toad Data Modeler User Guide
Projects and Models

You want to create a macro that will add a particular prefix to all
attributes in your model.
Solution: You will create a macro Add Prefix. The macro will be
available via right-click menu on the Workspace. You want to create a
user form where you will define the prefix and decide if you want to
apply the change in Caption of attributes too.
1. Open Script Explorer.
2. Right-click the Macros item and select Add New Macro.
3. Right-click the new item and select Properties.
4. On tab General, define properties of the macro.
Important! – Name of macro mustn’t contain spaces and other forbidden
characters. The name must start with a character (not number). Then you can
use characters, numbers or possibly '_'. The rules don’t refer to caption.
Caption can be any title you want.

606

Toad Data Modeler User Guide

607

Projects and Models

5. On tab Visibility, select where you want to apply the macro – Physical Model.
6. On tab Menu, define whether you want to display the macro in:
l

Macro menu,

l

pop-up menu,

l

both places.

Parameter Path specifies position in main menu (or pop-up menu). Example:
'Test\My Items'.
In this example, you decide to display it only in pop-up menu.
Path box is empty as 'Macros' item is set as default.

7. On tab Object Types, select in which object pop-up menu you want to display it. Select
Workspace.
Confirm OK.

Toad Data Modeler User Guide

608

Projects and Models

8. Double-click the macro in Script Explorer to open Script Editor. Modify the default code.

Toad Data Modeler User Guide
Projects and Models

9. Click Commit and Save.
10. Right-click the Workspace |Macros |Add Prefix to open the user form.

609

Toad Data Modeler User Guide
Projects and Models

Productivity Pack
Productivity pack contains three macros.
l

Add Entities

l

Add Attribute to Selected or All Entities

l

Copy Attribute to All Entities

Add Entities
Click Macros | Productivity | Add Entities to run the macro.

610

Toad Data Modeler User Guide
Projects and Models

The same macro can be executed from Workspace.

New dialog opens. Specify entity captions, one per line.

Click Execute to create the new tables.

611

Toad Data Modeler User Guide

612

Projects and Models

The tables will be added to your model.
In case your workspace option Autocomplete is activated the entities will appear also on
our workspace.

Add Attribute to Selected or All Entities
Click Macros | Productivity | Add Attribute to Selected or All Entities to run the macro.
New dialog opens. Specify caption, name, data type and other options.
Tip: If you wish to use table caption/name as prefix, type a "space" as the first character in
Attribute Caption field and an underscore as the first character to Attribute Name field.

Toad Data Modeler User Guide

613

Projects and Models

Note that if you enable Add to Key checkbox, the Not Null checkbox disappears.

In case you selected some entity, the attribute will be added to the selected entity. Otherwise the
following dialog opens.
Click Yes to add attribute to all entities.

Result:

Toad Data Modeler User Guide

614

Projects and Models

Verification: There is some basic verification of required items.

Notes:
l

If you run the macro on entities with identically named attributes, the attribute will not
be added to the entity more than once.

Toad Data Modeler User Guide

615

Projects and Models

l

If you specify Varchar(%p1 %p2) as the data type, you need to know whether the second
parameter is BYTE or CHAR. There is no verification for parameter values.

Copy Attribute to All Entities
Select attribute in physical Model Explorer, right click on it and choose Macros | Copy
Attribute to All Entities.

It is possible to run the macro from Object Viewer also.

Toad Data Modeler User Guide
Projects and Models

Result:

Notes:
l

Attribute will be added only to the entities which don't have an identically
named attribute.

616

Toad Data Modeler User Guide
Projects and Models

Sources
You can find them in Package Explorer in section Productivity Pack | Macros.
Right click any macro and choose Edit Source Code to see JavaScript code.

Rename Objects Pack
Rename Objects Pack contains four macros.
l

Rename Primary Keys

l

Rename Relationships

l

Rename Check Constraint Names

l

Rename View Relationships

617

Toad Data Modeler User Guide

618

Projects and Models

Rename Primary Keys
This macro renames primary keys to PK_<tablename>.
When you create a new entity, its primary key is named Key1.

When you execute the macro, key name and caption changes.

Notes:
l

If you select entity, the macro will modify primary key name and caption of the selected
entity only.

l

If you need to change the prefix or if you wish to use suffix, create a new macro and
modify its JavaScript code accordingly.

Toad Data Modeler User Guide

619

Projects and Models

Rename Relationships
This macro renames relationship captions and names and modifies them to:
New caption: <parenttablecaption> - <childtablecaption>
New name: <parenttablename>_<childtablename>
By default, relationships are named as Relationship1, Relationship2 etc. When you execute the
macro, the following result is achieved:

Notes:
l

If you select relationship, the macro will modify only the selected relationship, otherwise
you will be asked if you wish to run the macro on all relationships.

l

If multiple relationships exist between two entities, a random number will be added at the
end of the relationship name.

Rename Check Constraint Names
This macro renames Table and Column check constraint names and captions.
By default, Toad Data Modeler names check constraints as CheckConstraint1,2,3 etc.

Toad Data Modeler User Guide

620

Projects and Models

After you execute the macro, check constraints will be renamed to CHK_<tablename>_<index>
and CHK_<columnname>_<index>.

Notes:
l

If you select an entity, the macro will modify check constraint names and captions of the
entity and its attributes.

l

If you need to change the prefix or if you wish to use suffix, create a new macro and
modify its JavaScript code accordingly.

Rename View Relationships
This macro works similarly to Rename Relationships macro.
New caption: <object1caption> - <object2caption>
New name: <object1name>_<object2name>

The macro renames existing View relationships.

Result:

Toad Data Modeler User Guide

621

Projects and Models

Notes:
l

If you select a View relationship, the macro will modify only the selected View
relationship, otherwise you will be asked if you wish to run the macro on all View
relationships.

l

If multiple View relationships exist between two objects, a random number will be added
at the end of the View relationship name.

Metamodel
About Metamodel in Toad Data Modeler
Toad Data Modeler supports metamodels. Metamodels are available only in Expert Mode (via
Package Explorer).
Metamodel is a graphical representative of objects (classes, properties, methods...) that belong to
the selected package, or references to objects defined in the application.
In metamodels, you can create new classes, properties, methods, associations, generalizations (it
is very similar to UML Class Diagram).
Metamodels are available for creation or modifications of:
l

Classes

l

Properties

l

Methods (Functions and Procedures)

You can also model associations and generalizations, add notes and other logical data to
metamodels.
Note: In your metamodel, it is recommended to use only ANSI code (A - B without any special
characters and numbers).
Example: Oracle package metamodel

Toad Data Modeler User Guide
Projects and Models

Open Metamodels
1. Open

(or select Expert Mode | Customization | Package Explorer).

2. Select a package.
3. Right-click the package and select Open Metamodel.

622

Toad Data Modeler User Guide
Projects and Models

Classes
Add Existing Classes to Metamodel
1. Right-click the work area and select Add Class.

2. In the Class Selection dialog, select a class and define settings on tab Settings.

623

Toad Data Modeler User Guide

624

Projects and Models

Result: The selected class will be added to your metamodel and you will be able to modify it.

Create Classes
»

Click Class

on the toolbar and then anywhere in the work area.

or
Select Model | Classes and click Add in the Classes dialog.
To add multiple classes on the Workspace
1. Press SHIFT and click the Class icon. A blue frame displays in the icon.
2. Click the work area as many times as many classes you want to add.
3. Right-click the work area (or click the Class icon again) to turn this function off.
To see all classes of your model
»

Select Model | Model Items |Classes. In the Classes dialog, you can add, edit classes,
edit their names (F2) and delete them.

Edit Classes
»

Double-click the class graphics on the Workspace.

Toad Data Modeler User Guide

625

Projects and Models

or
Edit the class in the Classes dialog (Model menu | Model Items | Classes | Edit).

General Tab

Description

Name

Defined object class. Its value
CSAOClassName + Abbreviation.

consists

of

Example:
PERSequenceOR
PER = Physical Entity Relationship model
Sequence = Sequence
OR = Oracle (all Oracle databases. OR10 stands for
Oracle 10g, OR9 is for Oracle 9i etc.)
Object Type

Numeric representation of object class without
dependence on database system. A list of Object
types is available in the TDM Reference document.

External

This checkbox has just an informative value. External
class represents a class created in metamodel.

Toad Data Modeler User Guide

626

Projects and Models

Default Name

Default name that will be assigned to the object after
its creation. If you add "%d" to the default name, a
numeric value will be added to the end of the default
name.

Category

Category selection box. To see a list of Categories of
your model, click the small button on the right.

Properties
Tab

List of class properties.

Methods Tab

List of methods that belong to the class.

Inherited
Properties
Tab

Properties defined in predecessors.

Inherited
Methods Tab

Methods defined in predecessors.

Description
Tab

Write description notes on the class here.

Notes Tab

Write notes on this tab.

To Do Tab

On this tab, you can write some tasks on the class.

Properties
Create Properties
1. In the Class Properties form, click the Properties tab.
2. Click Add.
3. Confirm Apply.
4. Edit the new item and define properties of the new property.

Edit Properties
»

Double-click a property or press Edit in the Class Properties dialog | Properties tab.

Toad Data Modeler User Guide
Projects and Models

General Tab

Description

Name

Name of property

Data Type

Property data type

Default value

Property default value

External

Only properties that are marked as External are taken
to particular class. Every new property defined by
users must be set as External, otherwise the property
will not be accessible in the class. If you need to add
a property for just an informative purpose to your
metamodel, clear the checkbox External.

Implementation
Area

Description

Get Script
Method and Set
Script Method

Access methods for property. Name consists of
ScriptName.MethodName - without brackets.
Click the button next to the Get Script Method or
Set Script Method fields to assign default values
there.
Example: PERSequenceOR.GetIncrementBy

Package

Name of package where the access methods are
stored

Overridable

Select to set the property as Overrideable.

Dynamic

Select to set the property as Dynamic.

Read Only

Select to set the property as Read Only.

Write Only

Select to set the property as Write Only.

Attributes Tab

On tab Attributes , you can assign attributes to
properties. Every attribute may change class
behaviour.
Example: You create a new property
MyDescription. This property will be used for
storing data entered into a new Text Field in the
Entity Properties form. For this purpose, the
following property attributes must be enabled:
Editable and Store.
Tip: A list of attributes is accessible via Model |
Attributes menu.

627

Toad Data Modeler User Guide
Projects and Models

Methods
Create Methods
»

In theClass Properties dialog | Methods tab | Add.

Edit Methods
»

Double-click a method or press Edit in the Class Properties dialog | Methods tab.

General Tab

Description

Name

Name of method

Result Data
Type

Data type that the method returns

External

Only methods that are marked as External will be
taken to particular class. Every new method defined
by users must be set as External, otherwise the
method will not be accessible in the class. If you
need to add a method for just an informative purpose
to your metamodel, clear the checkbox External.

Implementation
Area

Description

Method

Location of the access methods of property in the
form: ScriptName.MethodName. After you click
, default value will be inserted to this box.

Package

Name of package where the access methods are
stored.

Parameters
Tab

Add parameters to methods on this tab.
Click Add to create a new method parameter.

628

Toad Data Modeler User Guide

629

Projects and Models

Generalizations
Generalization
Generalization is a link that defines a relation between two classes. Using generalizations, you
can model inheritance.
Child class has all properties and methods of parent class, plus it may add new behaviors. If you
create a new class (class name doesn't exist), then it will be necessary to define an inheritance to
more general classes from the core or its successors.
To create Generalization
1. Click

on the toolbar.

2. Move your mouse cursor over the work area.

Toad Data Modeler User Guide

630

Projects and Models

3. Click parent class and then the child class.

Edit Generalizations
»

Double-click the generalization line on the Workspace.
or
Edit the generalization in the Generalizations dialog (Model menu | Model Items
|Generalizations).

Associations
Associations / Aggregations
Associations and aggregations represent a relationship between two classes. If one class owns
another class, then it's an aggregation. (Attribute has a Domain, Entity is owned by Model and
Model has a list or collection of Entities etc.)
To create Associations / Aggregations
1. Click

on the toolbar.

2. Move your mouse cursor over the work area.
3. Click the first class and then the target class.

Edit Associations
»

Double-click the association line on the Workspace.
or
Edit the association in the Associations dialog (Model menu | Model Items
|Associations).

General Tab

Description

Name

Name of the association/aggregation

Toad Data Modeler User Guide
Projects and Models

Advanced Tab

Description

Role

Name of property that will be added to class

Aggregation

Represents an owner of the second class.

Many

Property created in the second class will not be of the
Dispatch type but the List type, and will work as a
collection.

External

External associations create new properties in the
selected class. Clear the External checkbox not to
create the properties. In both cases, a relationship
with information about linkages is created.

Attributes1,
Attributes2
Tab

Represent attributes that can be assigned to classes on
both sides of the association or aggregation. Names of
properties are defined on tab Advanced in the Role
box. Every attribute may change class behavior.
A list of attributes is accessible via Model menu |
Attributes.

Script Samples
Creating New Objects
In this topic you can find information about how to create new objects via scripting.
Creating a new Entity
function main()
{
var app = System.GetInterface('Application');
var Model = app.Models.GetObject(0);
Model.Lock();
var Entity = Model.CreateNewObject( 2002 ); // 2002 is object
type of PEREntity
Entity.Name = 'Customer';
Model.UnLock();

631

Toad Data Modeler User Guide

632

Projects and Models

Model.RefreshModel();
}

More information about the Entity object can be found in the Reference. See PEREntity class or
PEREntityOR (for Oracle) class etc.

Creating a new Index
function main()
{
var app = System.GetInterface("Application");
var Model = app.Models.GetObject(0); // gets first model in
application
Model.Lock();
var Entity = Model.Entities.GetObject(0); // gets first
entity in model

Toad Data Modeler User Guide
Projects and Models

Attribute = Entity.Attributes.GetObject(0); // gets first
attribute in entity
var Index = Entity.CreateNewObject( 2012 ); // 2012 is object
type of PERIndex
Index.Name = "IXName";
var IndexItem = Index.CreateNewObject ( 2013 ); //2013 is object
type of PERIndexItem
IndexItem.Attribute = Attribute;
Model.UnLock();
Model.RefreshModel();
}

Creating a new Domain
function main()
{
var app = System.GetInterface('Application');
var Model = app.Models.GetObject(0);
var Domain;
var DataType_Number = Model.ModelDef.DataTypes.GetObjectById("
{3A22E4F9-EE24-4A39-835D-62C3EF76CAA4}"); // Number(x,y);
Model.Lock();
Domain = Model.CreateNewObject( 2006 ); // 2006 is object type
of PERDomain
Domain.Name = 'MyDomain';
Domain.SetLinkedObject("DataType", DataType_Number);
Domain.DataTypeParam1 = "10";
Domain.DataTypeParam2 = "2";
Model.UnLock();
}

633

Toad Data Modeler User Guide

634

Projects and Models

Iterate Entity And Attributes
This sample shows you how to iterate entities and attributes and how to recognize PK, PFK or
FK attributes.
function main()
{
var app = System.GetInterface('Application');
var Model = app.Models.GetObject(0); // gets first model in
application
var e, a, iterEntity, iterAttribute;
Model.Lock();
for (e=0; e<Model.Entities.Count; e++) // iterate entities
{
iterEntity = Model.Entities.GetObject(e);
iterEntity.Lock();
for (a=0; a<iterEntity.Attributes.Count; a++) // iterate
attributes

iterAttribute = iterEntity.Attributes.GetObject(a);
if(iterAttribute.IsPrimaryKey == 1) // check if attribute is PK
{
if(iterAttribute.FKForeignKeys.Count !=0)
Log.Information(iterEntity.Name+'-'+iterAttribute.Name+'-PFK');
else
Log.Information(iterEntity.Name+'-'+iterAttribute.Name+'-PK');
}
else
{
if(iterAttribute.FKForeignKeys.Count !=0)
Log.Information(iterEntity.Name+'-'+iterAttribute.Name+'-FK');
}
}

Toad Data Modeler User Guide
Projects and Models

iterEntity.UnLock();
}
Model.UnLock();
Model.RefreshModel();
}

Getting Settings Information
In Toad Data Modeler you can access Application Settings via ApplicationConfig class:

function main(){
var App = System.GetInterface("Application");
var Log = System.CreateObject("Log");
var Model = App.Models.GetObject(0);
Log.Information(App.ApplicationConfig.PackagePath);
}

If you need to find out the path to the folder where your model is stored, use the property
FilePath of the Model object (PERModel class):

function main(){
var App = System.GetInterface("Application");
var Log = System.CreateObject("Log");
var Model = App.Models.GetObject(0);
Log.Information(Model.FilePath);
}

More information can be found in the Reference.

635

Toad Data Modeler User Guide
Projects and Models

Dialogs
Samples for Message Dialogs:
ShowMessageDialog
System.ShowMessageDialog(1004,'WarningDialog','Please select
shapes on your Workspace before running the macro.',2,4);

Dialog type index
0 - warning
1 - error
2 - info
3 - confirm
4 - no icon
Dialog buttons index
0 - no button
1 - yes
2 - no
3 - yes/no
4 - ok

636

Toad Data Modeler User Guide
Projects and Models

5 - yes/ok
6 - no/ok
7 - yes/no/ok
8 - cancel
9 - yes/cancel
10 - no/cancel
11 - yes/no/cancel….

ShowMessageDialogScript
This way you can create dialog with hyperlinks at the bottom.

var DlgParams = System.CreateObject('DialogParams');
DlgParams.Caption = 'Add Entities Info';// Name appears in
Settings | Options in section Dialog Boxes.
DlgParams.DialogIndex = 202; // Unique number, must be above 200
DlgParams.Msg = 'This macro allows you to quickly add entities to
your model. Specify one entity caption per line. ';
DlgParams.Msg += 'Spaces in entity captions can be converted to
entity names as underscore characters. ';
DlgParams.Msg += 'For more infomation click the Help link at
bottom. Do you wish to continue?';
DlgParams.Buttons = 3;
DlgParams.DlgType = 2;
DlgParams.HyperLink =
'http://www.casestudio.com/help/ProductivityPack.aspx';
DlgParams.HyperLinkCaption = 'Help';
DlgParams.ScriptName = 'AddEntitiesMacro';

if(System.ShowMessageDialogScript(DlgParams) != 6)
{
return;

637

Toad Data Modeler User Guide
Projects and Models

}

File System Scripts
You can create new files or folders using simple javascript code.

function CreateFolder(folder)
{
var fso;
fso = new ActiveXObject("Scripting.FileSystemObject");
fso.CreateFolder (folder);
}

function CopyFolder(sourceFolder, destinationFolder, overwrite)
{
var fso;
fso = new ActiveXObject("Scripting.FileSystemObject");
fso.CopyFolder (sourceFolder, destinationFolder, overwrite);

638

Toad Data Modeler User Guide

639

Projects and Models

}

function CopyFile(sourceFile, destinationFile)
{
var fso;
fso = new ActiveXObject("Scripting.FileSystemObject");
fso.CopyFile (sourceFile, destinationFile);
}

Automation
How to call Toad Data Modeler from other applications
Toad Data Modelercan be called from other applications, for example by running
JavaScript code.
Benefits
l

Possibility to generate SQL, documentation or alter reports silently in scheduled time etc.

l

Possibility to reverse engineer database via script

l

Batch conversion of models to selected target database platform and more...

Samples
In this section you can find samples for better understanding how Automation can be used.

Generate SQL code
This example show how to generate SQL code.
Generate.js
//*****************************************************
function Generate(Model, Output)
{

Toad Data Modeler User Guide
Projects and Models

var Generator = Model.DefaultCodeGenerator;
Generator.GenerateToFile(Output);
}
//*****************************************************
var App;
App = new ActiveXObject("TDM.App");

var Model = App.OpenModelFromFile("c:\\Models\\Videorental.txp");
Generate(Model, 'C:\\SQL\\VideorentalGeneratedScript.sql');
Model.Delete(); // From memory only.

Generate HTML report
How to generate HTML report.
HtmlReport.js
//*****************************************************
function HTMLReport(Model, System, OutputPath)
{
var ReportRegistrar = System.CreateObject('ReportRegistrar');
ReportRegistrar.DataSource = Model;
var Report = ReportRegistrar.CreateReport
('BasicHTMLPERReport'+Model.ModelDef.Abbrev, 1 , Model); //1 - HTML
ReportRegistrar.RegisterLayoutClasses(1);
Report.Path = OutputPath;
Report.FileName = 'Report';
Report.Language = 'ENU';
Report.Kind = 'HTML';
Report.Layout = ReportRegistrar.GetLayoutClass(0);
Report.CSS = Report.Layout.CSSList.GetObject(0);
Report.GenerateInfo = false;
Report.Generate();

640

Toad Data Modeler User Guide
Projects and Models

}
//*****************************************************
var App;
App = new ActiveXObject("TDM.App");
var Model = App.OpenModelFromFile("C:\\Models\\Videorental.txp");
HTMLReport(Model, App.System, 'C:\\Reports\\' );

Generate Alter Script
How to generate alter scripts.
GenerateAlter.js
//*****************************************************
function AlterFiles(App, FileName1, FileName2, Output)
{
var Model1 = App.OpenModelFromFile(FileName1);
var Model2 = App.OpenModelFromFile(FileName2);
var Convertor = Model1.CreateNewObjectInternal(25000);

Convertor.Model2ToAlter = true;
Convertor.Converting = true; // Do not modify.
Convertor.Altering = false; // Do not modify.
Convertor.Model1Model = Model1;
Convertor.Model2Model = Model2;
Convertor.CreateDefaultAlterScriptSetting();
Convertor.InitSelectedOTPs();
Convertor.InitAvailableOTPs();
Convertor.SelectPhysicalPropertiesOnlyInSelectedOTPs();
Convertor.AlterFileName = Output;
var Stream = App.System.CreateObject('TextStream');
Convertor.SynchronizeModels();
Convertor.LoadAllDifferences();

641

Toad Data Modeler User Guide
Projects and Models

Convertor.SelectAllModel1ToModel2(true, false);
Convertor.RunAlter();
Stream.Text = Convertor.AlterScript;
Stream.FileName = Convertor.AlterFileName;
Stream.SaveToFile();

Convertor.Delete();
Model1.Delete();
Model2.Delete();
}
//*****************************************************
var App;
App = new ActiveXObject("TDM.App");
AlterFiles(App,
"C:\\Models\\Videorental1.txp",
"C:\\Models\\Videorental2.txp",
"C:\\Alter.sql" );

Generate Alter Report
How to compare two models and generate alter report.
GenerateAlterReport.js
//*****************************************************
function AlterReport(App, FileName1, FileName2, OutputPath)
{
var System = App.System;
var Model1 = App.OpenModelFromFile(FileName1);
var Model2 = App.OpenModelFromFile(FileName2);
var Convertor = Model1.CreateNewObjectInternal(25000);

Convertor.Model2ToAlter = false;

642

Toad Data Modeler User Guide
Projects and Models

Convertor.Converting = true;
Convertor.Altering = false;
Convertor.Model1Model = Model1;
Convertor.Model2Model = Model2;
Convertor.CreateDefaultAlterScriptSetting();
Convertor.InitSelectedOTPs();
Convertor.InitAvailableOTPs();

Convertor.SynchronizeModels();
Convertor.LoadAllDifferences();
Convertor.SelectAllModel1ToModel2(true, false);

var ReportRegistrar = System.CreateObject('ReportRegistrar');
ReportRegistrar.DataSource = Convertor;
var Report = ReportRegistrar.CreateReport('UniversalHTMLAlterReport', 6,
Convertor); // 6 - diff HTML
ReportRegistrar.RegisterLayoutClasses(6);
Report.Path = OutputPath;
Report.FileName = 'Report';
Report.Language = 'ENU';
Report.Kind = 'HTML';
Report.Layout = ReportRegistrar.GetLayoutClass(0);
Report.CSS = Report.Layout.CSSList.GetObject(0);
Report.Generate();

Convertor.Delete();
Model1.Delete();
Model2.Delete();
}
//*****************************************************
var App;

643

Toad Data Modeler User Guide
Projects and Models

App = new ActiveXObject("TDM.App");
AlterReport(App,
"C:\\Models\\Model1.txp",
"C:\\Models\\Model2.txp",
"C:\\Report Test\\"
)

Convert to PostgreSQL
How to convert model to PostgreSQL model.
ConvertToPg.js
//*****************************************************
function Convert(Model, App)
{
var Convertor = Model.CreateNewObjectInternal(25000);
Convertor.Model2ToAlter = false;
Convertor.Model2ToConvert = true;
Convertor.Model2ModelTemp = true;

Convertor.Converting = true;
Convertor.Altering = false;
Convertor.Model1Model = Model;

var PM = App.System.GetInterface('PackageManager');
var DestinationMDef = PM.ModelDefs.GetObjectByName('PostgreSQL 9.0');
DestinationMDef.LoadPackages();

Convertor.Model2ModelDef = DestinationMDef;
Convertor.Model2Model = App.NewModel(2001, DestinationMDef, true, true);
//2001 = Physical ER Model (PERModel)

644

Toad Data Modeler User Guide

645

Projects and Models

Convertor.CreateDefaultAlterScriptSetting();
Convertor.InitSelectedOTPs();
Convertor.InitAvailableOTPs();

Convertor.SynchronizeModels();
Convertor.LoadAllDifferences();
Convertor.SelectAllModel1ToModel2(true, false);
Convertor.RunConvert();

var Result = Convertor.Model2Model;
Convertor.Delete();
return Result;
}
//*****************************************************
function Generate(Model, Output)
{
var Generator = Model.DefaultCodeGenerator;
// Example that shows how to change generator settings. For more information
see Reference Guide class PERCodeGenerator
Generator.UseQuotations = false;
Generator.GenerateToFile(Output);
}
//*****************************************************
var App;
App = new ActiveXObject("TDM.App");
//Source Model Path
var Model = App.OpenModelFromFile("C:\\Videorental-SQLServer.txp");
var ModelPG = Convert(Model, App);
// Save model
App.SaveModelToFile(Model, 'C:\\test.txp'));
// Generate SQL

Toad Data Modeler User Guide
Projects and Models

Generate(ModelPG, 'C:\\SQL\\script.sql');
// Delete only from memory.
ModelPG.Delete();
Model.Delete();

Reverse Engineering using existing Alias
How to use existing alias.
ReverseUsingExistingAlias.js
//*****************************************************
function LoadPackagesByModelDefName(AName, System)
{
var PM = System.GetInterface('PackageManager');
var MDef = PM.ModelDefs.GetObjectByName(AName);
MDef.LoadPackages();
}
//*****************************************************
function REByAlias(Alias)
{
var REDataMigrator = Alias.REDataMigrator;
REDataMigrator.InitiateREDataMigrator();
REDataMigrator.InitObjects();

var List = Alias.REStruct.Tables;
var i;
//Select some objects to RE, only example
for (i=0;i<List.Count;i++)
{
List.GetObject(i).Selected = true;
}

646

Toad Data Modeler User Guide
Projects and Models

Alias.REDataMigrator.LoadObjects();
if (Alias.REStruct.Model!=null)
{
return Alias.REStruct.Model;
}
else
{
return null;
}
}
//*****************************************************
function RE(AliasName, App, AModelDefName)
{
var REManager = App.REManager;
//Load Packages
LoadPackagesByModelDefName(AModelDefName, App.System);
var Alias;
Alias = REManager.REAliases.GetObjectByName(AliasName);
if (Alias==null)
{
var AliasPath = App.ApplicationConfig.AliasesPath;
Alias = REManager.LoadREAliasFromFile(AliasPath+AliasName+'.txa');
}

return REByAlias(Alias);
}
//*********************************************************************
var App;
App = new ActiveXObject("TDM.App");

var Model = RE('PG9 unidac', App, 'PostgreSQL 9.0');

647

Toad Data Modeler User Guide
Projects and Models

if (App.Application.SaveModelToFile(Model, 'C:\\test.txp'))
{
WScript.Echo("OK");
}
else
{
WScript.Echo("Error");
}

Reverse Engineering and New Alias
How to run new Reverse Engineering.
ReverseUsingNewAlias.js
//*********************************************************************
function REByAlias(Alias)
{
var REDataMigrator = Alias.REDataMigrator;
REDataMigrator.InitiateREDataMigrator();
REDataMigrator.InitObjects();

var List = Alias.REStruct.Tables;
var i;
//Select some objects to RE, only example
for (i=0;i<List.Count;i++)
{
List.GetObject(i).Selected = true;
}

Alias.REDataMigrator.LoadObjects();
if (Alias.REStruct.Model!=null)
{

648

Toad Data Modeler User Guide

649

Projects and Models

return Alias.REStruct.Model;
}
}
//*********************************************************************
function LoadPackagesByModelDefName(AName, System)
{
var PM = System.GetInterface('PackageManager');
var MDef = PM.ModelDefs.GetObjectByName(AName);
MDef.LoadPackages();
}
//*********************************************************************
function SetAliasParameters(REAlias)
{
var REDataProvider = REAlias.REDataProvider;
REDataProvider.SetConnectionParam('HostName', 'Localhost');
REDataProvider.SetConnectionParam('DatabaseName', 'Videorental');
REDataProvider.SetConnectionParamAsInt('Port', 0);
REDataProvider.SetConnectionParam('UserName', 'Scott');
REDataProvider.Password = 'Lion';
return REAlias;
}
//***************************************************************************
****************
var App = new ActiveXObject("TDM.App");
LoadPackagesByModelDefName('PostgreSQL 9.0', App.System);
var REManager = App.System.GetInterface('REManager');
var REAlias = REManager.CreateAlias('REDataSourceDBPG90',
'REDataProviderUniDACClientPG');
REAlias = SetAliasParameters(REAlias);

var Model = REByAlias(REAlias);
REAlias.Delete();

Toad Data Modeler User Guide

650

Projects and Models

if (App.SaveModelToFile(Model, 'C:\\Models\\Videorental.txp'))
{
WScript.Echo("OK");
}
else
{
WScript.Echo("Error");
}

Toad for Oracle Integration
About Integration Options
Toad Data Modeler and Toad for Oracle products have started the integration process.
Toad for Oracle - Basic Information on Product
Quest Software's Toad® for Oracle is a powerful application development tool built around an
advanced SQL - PL/SQL editor. Using Toad, you can build and test scripts, PL/SQL packages,
procedures, triggers, and functions. You can create and edit database tables, views, indexes,
constraints, and users. The Schema Browser and Project Manager provide quick access to
database objects.
Toad’s Editor provides an easy and efficient way to write and test scripts and queries, and its
powerful data grids provide an easy way to view and edit Oracle data. With the optional DB
Admin module you can manage space, compare schemas, monitor database performance, create
new databases, maintain redo logs, perform health checks, and much more.
Toad for Oracle Integration in Toad Data Modeler
l

Loading of Toad® for Oracle aliases

l

Opening Toad® for Oracle projects

l

Importing Toad® for Oracle ER diagrams

l

Possibility to define Toad® for Oracle as a default editor for generated SQL scripts

l

Possibility to use Toad® for Oracle icons in Toad Data Modeler

l

Import of Toad® for Oracle templates. See "Toad for Oracle TemplatesToad Data Modeler
allows you to import the templates you created in Toad for Oracle and refresh them at any
time you need.We do not recommend to modify these templates in Toad Data Modeler as

Toad Data Modeler User Guide

651

Projects and Models

export of the templates to Toad for Oracle is not possible.Toad Data Modeler imports
Toad for Oracle templates of the following objects:Stored ProceduresFunctionsEntity
TriggersPackages (object in Oracle)To import Toad for Oracle template to Toad Data
ModelerOpen Template Editor - Select Settings | Template Editor.Click . The following
dialog displays:Confirm OK and take notice of new templates in Template Editor (e.g.
"Default" templates). Note: The Toad for Oracle templates are stored in TOAD.txg file at:
C:\Documents and Settings\user name\My Documents\Toad Data Modeler\Installation
name\Packages\{GUI}To refresh your existing Toad for Oracle templates in Toad Data
ModelerClick . Toad for Oracle Auto Replacement WordsToad Data Modeler allows you
to use Application Variables in your templates. See….Toad for Oracle templates can have
Auto Replacement Words.During import of Toad for Oracle templates, the Toad for
Oracle Auto Replacement Words are replaced by Toad Data Modeler Application
Variables. See how:Toad for Oracle Auto Replacement WordToad Data Modeler
Application
Variable%YourObjectName%<%FullName%>%Date%<%Date%>%SysDate%<%Date%
>%DateTime%<%DateTime%>%Time%<%Time%>%TableName%<%TableFullName%
>%UserName%'<%Author%>Note: Not all Toad for Oracle Auto Replacement Words are
supported. " (page 1) for more information.

Default Settings for Toad for Oracle Integration
»

Select Settings | Options | Application | Toad for Oracle Integration.

Toad Data Modeler User Guide

652

Projects and Models

Notes:
1. Since Toad for Oracle 10.0, the list of installed programs is not saved to registry but to a
special file SettingsLocations.ini. What it means in reality: During start-up Toad Data
Modeler searches for all Toad for Oracle versions that you have on your computer. By
default Toad Data Modeler pairs with the last installed Toad for Oracle version. Once the
Toad for Oracle version is found, it is written in Config file of Toad Data Modeler.
If you want Toad Data Modeler to pair with another Toad for Oracle version, you have to
define it manually in Toad Data Modeler: Settings | Options | Toad for Oracle
Integration.
2. Toad for Oracle cannot auto-detect Toad Data Modeler. To detect Toad Data Modeler via
Toad for Oracle, select the Detect checkbox at the bottom in this window.

Toad for Oracle Connections
Toad Data Modeler recognizes Toad for Oracle connections and displays them on tab Toad for
Oracle Connections in the:
l

Connections dialog (File | Connections). The imported connections are displayed in
gray color.

l

Reverse Engineering Wizard | Stored Connections page (File | Reverse Engineering).

Note: Toad Data Modeler allows you to use Toad for Oracle aliases but it doesn't allow you to
save changes to these aliases.

Toad Data Modeler User Guide

653

Projects and Models

Related Topics
Create New Model from Database - Reverse Engineering (page 255)
Open Object Explorer - Live Reverse Engineering (page 257)

Open Toad for Oracle Projects
1. Select File | Import | Open Toad for Oracle Project.
2. From the Open dialog, select *.tpr file. Toad Project Manager opens.
3. Select a connection type, right-click it and select Connect.

4. After you are connected, you can select items from the Toad Project Manager and drag
them to the Workspace or Model Explorer of your model in Toad Data Modeler.
5. Right-click the connection and select Disconnect or simply close Toad Project
Manager.
Note: Tables that already exist in the model cannot be added to the model.

Related Topics
Command Line Parameters (page 379)
Import Toad for Oracle ER Diagrams (page 653)

Import Toad for Oracle ER Diagrams
1. Select File | Import |Toad for Oracle ERD or open the Connections form and click
Import Toad ERD...

Toad Data Modeler User Guide
Projects and Models

2. From the Open dialog, select particular *.erd or *.erx file and click Open.

3. If you wish to use connection string stored in ERD file, click Yes on the
following dialog window:

654

Toad Data Modeler User Guide
Projects and Models

4. The import starts.

5. Result:

In the .erd file, there is only information on tables. Now it is necessary to connect
to database to load information on attributes and other items of the ER diagram. In
other words, reverse engineering has to be done to create a new model in Toad
Data Modeler. The reverse engineering should be completed automatically and the
only information you might need is password to your database connection.

Related Topics:
Command Line Parameters (page 379)

655

Toad Data Modeler User Guide

656

Projects and Models

Toad for Oracle as Default Editor
Select Toad for Oracle as a default editor to open every generated SQL script in Toad for Oracle
(Oracle models only).
You can define any other third party application as default editor.
See "Define External Editor for particular database" (page 469) for more information.

Toad for Oracle Icons
»

Click View | Icon Theme and select Toad for Oracle Icons. See the change on the
toolbar and Model Explorer.

Toad Data Modeler User Guide
Projects and Models

657

Toad Data Modeler User Guide

658

Databases

Databases
Supported Databases

Supported Database
System

DB2 z/OS v. 10
DB2 z/OS v. 9
DB2 v. 10.1 (LUW)
DB2 v. 9.7 (LUW)
DB2 v. 9.5 (LUW)
DB2 v. 9 (LUW)
DB2 UDB v. 8
(LUW)
Greenplum 4.1
Greenplum 4.2
Ingres 10.0
Ingres 9.3
Microsoft Access
2007/2010
Microsoft Access
2000-2003
Microsoft SQL Azure
Microsoft SQL
Server 2012
Microsoft SQL
Server 2008

Reverse
Engineering

Import
From SQL
File

Alter Script
Generation

SQL/DDL
Code
Generation

Toad Data Modeler User Guide

659

Databases

Supported Database
System

Microsoft SQL
Server 2005
Microsoft SQL
Server 2000
MySQL 5.5
MySQL 5.1
MySQL 5.0
Oracle 11g R2
Oracle 11g R1
Oracle 10g
Oracle 9i
PostgreSQL 9.2
PostgreSQL 9.1
PostgreSQL 9.0
PostgreSQL 8.4
PostgreSQL 8.3
PostgreSQL 8.2
PostgreSQL 8.1
SQLite 3.7
Sybase ASE 15.7
Sybase ASE 15.5
Sybase ASE 15
Sybase ASE 12.5

Reverse
Engineering

Import
From SQL
File

Alter Script
Generation

SQL/DDL
Code
Generation

Toad Data Modeler User Guide

660

Databases

Supported Database
System

Reverse
Engineering

Import
From SQL
File

Alter Script
Generation

SQL/DDL
Code
Generation

Sybase IQ 15.2
Sybase SQL
Anywhere 11
Teradata 13
Other databases
(Universal Model)

Learn details (reverse engineering, specifics, script generation etc.) about your particular database
version in chapter "Databases".
Support for latest versions of other database systems will be added to the product gradually.
Note: Toad Data Modeler includes also support of Universal DB/ANSI Models. See "Universal
DB/ANSI Model" (page 262) for more information.

Toad Data Modeler User Guide
Databases

DB2 UDB v. 8 (LUW)
Specifics - DB2 UDB v. 8 (LUW)
User Data Type

661

Toad Data Modeler User Guide
Databases

662

Toad Data Modeler User Guide
Databases

Function

663

Toad Data Modeler User Guide
Databases

664

Toad Data Modeler User Guide
Databases

Procedure

665

Toad Data Modeler User Guide
Databases

Related Topics
Specifics - DB2 v. 9 (LUW) (page 668)

666

Toad Data Modeler User Guide
Databases

Script Generation - DB2 UDB v. 8 (LUW)

Extra Objects - DB2 UDB v. 8 (LUW)
See the extra objects in Model Explorer:
l

Sequences

l

Tablespaces

667

Toad Data Modeler User Guide
Databases

DB2 v. 9 (LUW)
Specifics - DB2 v. 9 (LUW)
Entity

668

Toad Data Modeler User Guide
Databases

Attribute

Data Types:
For Char, Long Varchar and Varchar data types, you can define For Bit Data.
For Blob(x), Clob(x) and DBClob(x) data types, you can define unit of length.

669

Toad Data Modeler User Guide
Databases

Relationship

670

Toad Data Modeler User Guide
Databases

Index

671

Toad Data Modeler User Guide
Databases

Check Constraint

672

Toad Data Modeler User Guide
Databases

Trigger

673

Toad Data Modeler User Guide
Databases

View

674

Toad Data Modeler User Guide
Databases

Materialized View

675

Toad Data Modeler User Guide
Databases

676

Toad Data Modeler User Guide
Databases

Dictionary Type

Here, you can enter distinct types.

677

Toad Data Modeler User Guide
Databases

Synonyms

If you want to enter object that is not in the Object box, select Base Object is not in List
checkbox and enter the object in the new Base Object Name box.

Related Topics
Specifics - DB2 UDB v. 8 (LUW) (page 661)

Script Generation - DB2 v. 9 (LUW)

678

Toad Data Modeler User Guide
Databases

Extra Objects - DB2 v. 9 (LUW)
l

Security Labels

l

Security Policies

l

Sequences

l

Tablespaces

679

Toad Data Modeler User Guide
Databases

Sequences

680

Toad Data Modeler User Guide
Databases

DB2 v. 9.5 (LUW)
Specifics - DB2 9.5 (LUW)
Attribute

Data type DecFloat(x).

681

Toad Data Modeler User Guide
Databases

The Row Change Timestamp area is enabled only for Timestamp data type.
To enable the Implicitly Hidden Column, select the Row Change Timestamp checkbox.

682

Toad Data Modeler User Guide
Databases

Index

683

Toad Data Modeler User Guide
Databases

Dictionary Type

New Array Type.

684

Toad Data Modeler User Guide
Databases

Script Generation - DB2 9.5 (LUW)

Extra Objects - DB2 9.5 (LUW)
See the extra objects in Model Explorer:
l

Security Labels

l

Security Policies

l

Sequences

l

Tablespaces

685

Toad Data Modeler User Guide
Databases

DB2 v. 9.7 (LUW)
Specifics - DB2 9.7 (LUW)
Attribute

686

Toad Data Modeler User Guide
Databases

Index

687

Toad Data Modeler User Guide
Databases

Dictionary Type

688

Toad Data Modeler User Guide
Databases

User Data Type

689

Toad Data Modeler User Guide
Databases

Stored Procedure

690

Toad Data Modeler User Guide

691

Databases

Synonym

Aliases (Synonyms) are supported, including Public Synonym:
Public Synonym specifies that the alias is an object in the system schema SYSPUBLIC.
To select a sequence in the list of objects, open the Synonym Properties dialog | General tab |
Object box.
If the sequence is not defined in the model, select the Base Object is not in List checkbox and
write the sequence to box Base Object Name (start with text SEQUENCE).

Toad Data Modeler User Guide
Databases

Script Generation - DB2 9.7 (LUW)

692

Toad Data Modeler User Guide
Databases

Extra Objects - DB2 9.7 (LUW)
See the extra objects in Model Explorer:
l

Security Labels

l

Security Policies

l

Sequences

l

Tablespaces

693

Toad Data Modeler User Guide

694

Databases

DB2 v. 10.1 (LUW)
Extra Objects - DB2 10.1 (LUW)
See the extra objects in Model Explorer:
l

Security Labels

l

Security Policies

l

Sequences

l

Tablespaces

Specifics - DB2 10.1 (LUW)
Function
[NOT] SECURED (Secured checkbox on Function Parameters pane)- added for function types

External Scalar, External Table, OLE DB, SQL
Example:
CREATE FUNCTION CENTRE3 (INT,FLOAT)
RETURNS FLOAT
EXTERNAL NAME 'mod!middle'
LANGUAGE C
PARAMETER STYLE SQL
DETERMINISTIC
NO SQL
NO EXTERNAL ACTION
SECURED

Index
Business Time Without Overlaps option added on General pane.
Example of SQL:
CREATE TABLE policy_info
(
policy_id CHAR(4) NOT NULL,
coverage INT NOT NULL,
bus_start DATE NOT NULL,
bus_end DATE NOT NULL,
PERIOD BUSINESS_TIME (bus_start, bus_end)
);
CREATE UNIQUE INDEX ix_policy
ON policy_info (policy_id, BUSINESS_TIME WITHOUT OVERLAPS);

Toad Data Modeler User Guide

695

Databases

Unique Constraint
Business Time Without Overlaps option added.
Example of SQL:
CREATE TABLE policy_info6
(
policy_id CHAR(4) NOT NULL,
coverage INT NOT NULL,
bus_start DATE NOT NULL,
bus_end DATE NOT NULL,
PERIOD BUSINESS_TIME (bus_start, bus_end),
PRIMARY KEY(policy_id, coverage, BUSINESS_TIME WITHOUT
OVERLAPS)
);

CREATE TABLE policy_info4
(
policy_id CHAR(4) NOT NULL,
coverage INT NOT NULL,
bus_start DATE NOT NULL,
bus_end DATE NOT NULL,
PERIOD BUSINESS_TIME(bus_start, bus_end),
UNIQUE (policy_id, BUSINESS_TIME WITHOUT OVERLAPS)
);
Entity
Organize by Insert Time option added.
Example of SQL:

CREATE TABLE t2 (c1 int, c2 int, c3 int, c4 int)
ORGANIZE BY INSERT TIME
Compression Mode option added with values ADAPTIVE/STATIC
Example of SQL:
CREATE TABLE Entity5(Attribute1
ADAPTIVE
CREATE TABLE Entity6(Attribute1
ADAPTIVE VALUE COMPRESSION
CREATE TABLE Entity7(Attribute1
STATIC
CREATE TABLE Entity8(Attribute1
STATIC VALUE COMPRESSION

Char(1) NOT NULL) COMPRESS YES
Char(1) NOT NULL) COMPRESS YES
Char(1) NOT NULL) COMPRESS YES
Char(1) NOT NULL) COMPRESS YES

Period Definition (BUSINESS_TIME/SYSTEM_TIME values) option added.

Toad Data Modeler User Guide

696

Databases

Example of SQL:
CREATE TABLE policy_info
(
policy_id CHAR(4) NOT NULL,
coverage INT NOT NULL,
bus_start DATE NOT NULL,
bus_end DATE NOT NULL,
PERIOD BUSINESS_TIME (bus_start, bus_end)
);
CREATE TABLE policy_info3
(
policy_id CHAR(4) NOT NULL,
coverage INT NOT NULL,
sys_start TIMESTAMP(12) NOT NULL GENERATED ALWAYS AS ROW
BEGIN,
sys_end TIMESTAMP(12) NOT NULL GENERATED ALWAYS AS ROW END,
ts_id TIMESTAMP(12) NOT NULL GENERATED ALWAYS AS TRANSACTION
START ID,
PERIOD SYSTEM_TIME (sys_start, sys_end)
)

Attribute
New data types - nchar, nvarchar, nclob
New pane Generated replaced former Identity/Identity and Row Change Timestamp.
Trigger
Trigger event allows OR option, set for generating SQL script in Extended Value, option Create
or Replace.
Type
Array Type allows BOOLEAN data type.
Example of SQL:
CREATE TYPE typarraybool AS BOOLEAN ARRAY[VARCHAR(8)]

Aliases (Synonyms) are supported, including Public Synonym:
Public Synonym specifies that the alias is an object in the system schema SYSPUBLIC.
To select a sequence in the list of objects, open the Synonym Properties dialog | General tab |
Object box.
If the sequence is not defined in the model, select the Base Object is not in List checkbox and
write the sequence to box Base Object Name (start with text SEQUENCE).

Toad Data Modeler User Guide
Databases

DB2 z/OS v. 9
Extra Objects - DB2 z/OS v. 9
l

Sequences

l

Tablespaces

l

Databases

Sequences

697

Toad Data Modeler User Guide
Databases

Databases

698

Toad Data Modeler User Guide
Databases

Specifics - DB2 z/OS v. 9
Entity

699

Toad Data Modeler User Guide
Databases

Attribute

700

Toad Data Modeler User Guide
Databases

Relationship

701

Toad Data Modeler User Guide
Databases

Index

702

Toad Data Modeler User Guide
Databases

Trigger (Entity, View)

703

Toad Data Modeler User Guide
Databases

704

Toad Data Modeler User Guide
Databases

View

705

Toad Data Modeler User Guide
Databases

Materialized View

706

Toad Data Modeler User Guide
Databases

Stored Procedure

707

Toad Data Modeler User Guide
Databases

Function

708

Toad Data Modeler User Guide
Databases

Dictionary Type

709

Toad Data Modeler User Guide
Databases

Domain

710

Toad Data Modeler User Guide
Databases

Synonym

711

Toad Data Modeler User Guide
Databases

Script Generation - DB2 z/OS v. 9

712

Toad Data Modeler User Guide
Databases

DB2z-OS v.10
Extra Objects - DB2 z/OS v. 10
See Extra Objects - DB2 z/OS v. 9

Script Generation - DB2 z/OS v. 10
See Script Generation - DB2 z/OS v.9

713

Toad Data Modeler User Guide
Databases

Specifics - DB2 z/OS v. 10
Entity

714

Toad Data Modeler User Guide
Databases

Attribute

715

Toad Data Modeler User Guide
Databases

Key

716

Toad Data Modeler User Guide
Databases

Relationship

717

Toad Data Modeler User Guide
Databases

Index

718

Toad Data Modeler User Guide
Databases

Trigger (Entity, View)

719

Toad Data Modeler User Guide
Databases

720

Toad Data Modeler User Guide
Databases

View

721

Toad Data Modeler User Guide
Databases

Materialized View

722

Toad Data Modeler User Guide
Databases

Stored Procedure

723

Toad Data Modeler User Guide
Databases

Function

724

Toad Data Modeler User Guide
Databases

725

Toad Data Modeler User Guide
Databases

Dictionary Type

726

Toad Data Modeler User Guide
Databases

Domain

727

Toad Data Modeler User Guide
Databases

Synonym

Greenplum 4.1
Extra Objects - Greenplum 4.1
l

Aggregate

l

Sequences

l

Rewrite Rules

l

External Tables

728

Toad Data Modeler User Guide
Databases

Objects not supported in Toad Data Modeler:
l

Resource Queue

l

(Trusted) Protocol

l

Filespace

Note: Creation of some objects is not supported, e.g. Tablespace.

729

Toad Data Modeler User Guide
Databases

Aggregate

730

Toad Data Modeler User Guide
Databases

Sequence

Rewrite Rules
See Extra Objects - PostgreSQL 8.2 (page 899) topic for PostgreSQL 8.2 database for more
information.

731

Toad Data Modeler User Guide
Databases

External Tables
Object specific for Greenplum db not present in PosgtreSQL 8.2.

732

Toad Data Modeler User Guide
Databases

l

set External Table to be Readable/Writable
Writable External Table - enables Distribution Policy pane

733

Toad Data Modeler User Guide
Databases

l

set External Table to be Web or Regular type External Table
Web External Table - set Execute OS Command, Segment Instances, Parameter
of Segment Instances

l

Error Table Name - allows full table name, e.g. "schema1"."tablename"

Related Topics:
Extra Objects - PostgreSQL 8.2 (page 899)

Reverse Engineering - Greenplum 4.1
Only Native Connection option is available in Select Data Provider pane.

734

Toad Data Modeler User Guide

735

Databases

DB Identification - in case Host Name is not recognized, though being correct, put in IP.

Related Topics
Create New Model from Database - Reverse Engineering (page 255)

Specifics - Greenplum 4.1
Greenplum database is based on PosgtreSQL 8.2, which defines basic features and structure.
Supported features - SQL/DDL script generation, reverse engineering, HTML/RTF/PDF reports,
alter scripting, verification.
Permissions can be set for entities, views and functions.
Etity
General settings pane

Toad Data Modeler User Guide
Databases

Storage Parameters

736

Toad Data Modeler User Guide

737

Databases

Table Partitions
Define partitions/subpartitions textually

During reverse engineering, sub-tables of partitioned tables are filtered (the tables created
because of partitioned tables). Behavior can be influenced during setting reverse engineering,
checkbox Load Sub-Tables of Partitioned Tables.
Attribute
Array Type pane - Is Array Type checkbox, when selected, Array Dimension box is enabled

Toad Data Modeler User Guide
Databases

Dictionary Type/Domain

If Is Array Type is selected, Array Dimensions box is enabled.
Function
If C is selected in Language combo box, C Language Parameters pane appears.

If internal is selected in Language combo box, Internal Lanaguage Parameters pane appears.

738

Toad Data Modeler User Guide

739

Databases

Foreign Key (referential integrity)
NO FUNCTIONALITY - foreign key constraints are not supported in Greenplum Database.
Can be created, but are not enforced.
Trigger
Triggers can be created, but functionality is limited considerably!

Greenplum 4.2
Extra Objects - Greenplum 4.2
Aggregate Function
Ordered Aggregate option added. If selected, Preliminary Aggregation Function is disabled and
when applied (OK/Apply), combo box is set to -- Not Specified -- value)
Specifics - Greenplum 4.2 (page 739)

Specifics - Greenplum 4.2
Supported features - SQL/DDL script generation, reverse engineering, HTML/RTF/PDF reports,
alter scripting, verification.
Permissions can be set for entities, views and functions.
Entity
Storage Parameters pane- new option Block Size (in bytes) available if Append-Only Table
checkbox is selected.
Compress Type combo box - new options added:
l

ZLIB

l

QUICKLZ

Toad Data Modeler User Guide
Databases

l

RLE_TYPE

l

NONE

Attribute
Column Encoding - only in Column Oriented tables, cannot be combined with table's
compression parameters
l

Compress Type (ZLIB, QUICKLZ, RLE_TYPE, NONE)

l

Compress Level (0 to 9)

l

Block Size (in bytes)

External Table
Format - new option CUSTOM
User Data Type
Base Type - new options added
l

Compress Type (ZLIB, QUICKLZ, RLE_TYPE, NONE options)

l

Compress Level (0 to 9)

l

Block Size (in bytes)

Function
General pane - new With Parameter (Describe Functions) option, only for generating and
reporting functions
Extra Objects - Greenplum 4.2 (page 739)

Ingres
Extra Objects - Ingres 9.3
See the extra object in Model Explorer:
l

Sequences

740

Toad Data Modeler User Guide
Databases

Script Generation - Ingres 9.3

741

Toad Data Modeler User Guide
Databases

742

Toad Data Modeler User Guide
Databases

743

Toad Data Modeler User Guide

744

Databases

Select individual objects in Select tab you want to generate the script for and take advantage of
Filter if needed.

Toad Data Modeler User Guide
Databases

Specifics - Ingres 9.3

Synonyms

745

Toad Data Modeler User Guide
Databases

Entity / Index

Entity and Index dialogs containWith Clause tab.

Microsoft Access 2000/2002/2003
Script Generation - MS Access 2000/2002/2003
See Script Generation - MS Access 2007/2010 (page 747).

746

Toad Data Modeler User Guide

747

Databases

Specifics - Microsoft Access 2000/2002/2003
See Specifics - Microsoft Access 2007/2010 (page 751).

Microsoft Access 2007/2010
Script Generation - MS Access 2007/2010
Toad Data Modeler doesn’t generate an SQL script for the MS Access database, but does
generate a fully functional source code in the VBA language. The source code can be executed
directly in the MS Access as Module. Appropriate libraries in MS Access are necessary "Microsoft ActiveX Data Objects 2.x Library" and "Microsoft ADO Ext. 2.x for DDL and
Security" for ADO, or "Microsoft DAO 3.6 Object Library" for DAO.
To select a suitable library, click the Tools menu | References (in MS Access main menu).
In the beginning of every script generated for MS Access, you will see the following order:
'=======================================================
'=== MS Access 2007/2010 database creation method
'===
'=== 1. Create a new database in the MS Access
'=== 2. Create a new module
'=== 3. Copy the TDM3 output SQL script into the new MS Access module
'=== 4. Select from main menu "Tools" item "References..." and check
'===

the "Microsoft ActiveX Data Objects 2.x Library"

'===

and "Microsoft ADO Ext. 2.x for DDL and Security"

'===

and "Microsoft DAO 3.6 Object Library"

'=== 5. Place your mouse cursor somewhere in the main procedure Main()
'=== 6. Run the module code (Click the "Run Sub/UserForm" button or press F5)
'=======================================================

Toad Data Modeler User Guide
Databases

748

Toad Data Modeler User Guide
Databases

Example of a generated script:

749

Toad Data Modeler User Guide
Databases

750

Toad Data Modeler User Guide
Databases

Specifics - Microsoft Access 2007/2010
Entity

Select the Linked Table checkbox and fill out the following boxes (name: filled_value):
Link Datasource: C:\Documents and Settings\mario\Documents\MSAccess\fileaccess.mdb
Link Provider String: MS Access;PWD=mypassword
Remote Table Name: TableName

751

Toad Data Modeler User Guide

752

Databases

Attribute

Select the AutoNumber LI data type to display the Auto Number Type box. From this box, you
can select Increment or Random.
Select the Byte, Currency, Decimal, Double, Integer, Long Integer, Single data type to display
the Number of Decimal Places box.
Select the Hyperlink, Memo, Text data type to display the Allow Zero Length and Compress
Unicode checkboxes.

Toad Data Modeler User Guide
Databases

Keys

753

Toad Data Modeler User Guide
Databases

Relationship

754

Toad Data Modeler User Guide
Databases

Index

755

Toad Data Modeler User Guide

756

Databases

View

Note: User Data Types in the Model menu
Microsoft Access database does not have user data types. Nevertheless, these user data types in
Toad Data Modeler work only as an additional structure that can be used for a data type that
Microsoft Access database supports but that is not available in Toad Data Modeler.

Toad Data Modeler User Guide
Databases

Microsoft SQL Azure
Specifics - Microsoft SQL Azure
Entity

757

Toad Data Modeler User Guide

758

Databases

Attribute

Computed Column Expression box – Available for the Computed Column data type.
Persisted Computed Column checkbox – Available for the Computed Column data type.
Collation for The Column box – Available for data types Char(x), NChar(x), NText, NVarChar
(x), NVarChar(max), Text, VarChar(x), VarChar(max).

Toad Data Modeler User Guide

759

Databases

If a domain is selected in the Attribute Properties dialog, Domains box, and the domain has a
data type with selected Collation, the checkbox Override Collation Property is displayed in
the Attribute Properties dialog.

If a domain is selected in the Attribute Properties dialog, Domains box, the checkbox Override
Identity Property will be displayed on tab Identity.

Key
StatisticsNorecompute, Ignore_dup_key, IndexOptions, Clustered

Toad Data Modeler User Guide
Databases

See the Clustered checkbox on tab General.

Index
Predicate, StatisticsNorecompute, IndexOptions, IncludeCols, Ignore_dup_key

760

Toad Data Modeler User Guide
Databases

761

Toad Data Modeler User Guide

762

Databases

Include Columns List – If it is necessary, column names divided by comma are written there.
It is possible to set up Ascending/Descending for particular items of the index.

Toad Data Modeler User Guide
Databases

763

Toad Data Modeler User Guide
Databases

Check Constraint

764

Toad Data Modeler User Guide
Databases

Relationship

765

Toad Data Modeler User Guide

766

Databases

Domain

Computed Column Expression box - Available for the Computed Column data type.
Persisted Computed Column checkbox - Available for the Computed Column data type.
Collation for The Column box – Available for data types Char(x), NChar(x), NText, NVarChar
(x), NVarChar(max), Text, VarChar(x), VarChar(max).
See tab Identity for checkboxes Identity and boxes Identity Seed and Identity Increment.

Toad Data Modeler User Guide
Databases

Dictionary Type

User Data Type
TType, TableTypeList, SQL, GenerateSQLOnly

767

Toad Data Modeler User Guide

768

Databases

Possibility to define User-Defined Table Type in User Data Type.
Typebox – Only TABLE is possible to select.
User-Defined Table Type Definition box – E.g. LocationName VARCHAR(50), CostRate INT
If the checkbox Generate SQL Only is selected, tab SQL will be displayed.

Toad Data Modeler User Guide

769

Databases

Trigger (Entity, View)

Trigger Fire box – For entities you can select AFTER or INSTEAD OF
Trigger Events box with checkboxes Delete, Insert, Update
Execute as box – If 'user_name' is selected, a box where you can define the user name will
be displayed.

Toad Data Modeler User Guide

770

Databases

View

Tab Create Index - There is a box where you can write the complete command (or more)
CREATE INDEX with index definition for the particular view.
Tab View Comment – There you can write comments that should be generated in DDL script
before command CREATE VIEW.
Example: -- comment on my view

Toad Data Modeler User Guide

771

Databases

Procedure

Type of Stored Procedure box – Only Stored Procedure is possible to select.
Execute as box - If 'user_name' is selected, a box where you can define the user name will
be displayed.
Tab Procedure Comment - There you can write comments that should be generated in DDL
script before command CREATE PROCEDURE. Example: -- comment on my procedure

Toad Data Modeler User Guide

772

Databases

Function

Type of Function combo box– It is possible to select Scalar Function and Tablevalued Function.
Execute as box - If 'user_name' is selected, a box where you can define the user name will
be displayed.
OnNULLCall Attribute combo box – It is available only for Scalar Function.
Return Data Type box – For Table-valued Function they are called Returns.
Tab Function Comment - There you can write comments that should be generated in DDL script
before command CREATE FUNCTION.
Example: -- comment on my function

Toad Data Modeler User Guide

773

Databases

Synonym

Base Object is not in List checkbox - If the checkbox is selected, the Base Object box will be
displayed. There you can write a name of object for which the synonym is defined. This option
is used if the object is not available in the box Object.

Toad Data Modeler User Guide
Databases

Script Generation - Microsoft SQL Azure

774

Toad Data Modeler User Guide

775

Databases

Microsoft SQL Server 2000
Specifics - Microsoft SQL Server 2000
Please see the Specifics topic of Microsoft SQL Server 2005 database. The specifics of these two
databases are similar.
Important Note:
In Microsoft SQL Server 2000 db, there are no user defined types but only Dictionary types.
Dictionary types are called user-defined data types in Microsoft SQL Server 2000 database.

Toad Data Modeler User Guide
Databases

Script Generation - Microsoft SQL Server 2000

776

Toad Data Modeler User Guide

777

Databases

Note: To generate the table, column descriptions for SQL Server db in Toad Data Modeler,
schema/owner has to be defined. Please see the Entity Properties form | General tab and from
the Schema box select a schema or click the icon on the right to open the Schema dialog and
define a new schema, then select it for the entity.

Extra Objects - Microsoft SQL Server 2000
See the extra object in Model Explorer:
l

Filegroups

Toad Data Modeler User Guide
Databases

778

Toad Data Modeler User Guide

779

Databases

Microsoft SQL Server 2005
Specifics - Microsoft SQL Server 2005
Entity

Take notice of the Data Space area. If you click Filegroup, list of file groups will become
available and also appropriate options will display on the right. If you select Partition Scheme,
the options will change.
Description Tab
The description text is generated in final DDL script.
Note: To generate the table, column descriptions for SQL Server db in Toad Data Modeler,
schema/owner has to be defined. Please see the Entity Properties form | General tab and from
the Schema box select a schema or click the icon on the right to open the Schema dialog and
define a new schema, then select it for the entity.

Toad Data Modeler User Guide
Databases

Fulltext Index

780

Toad Data Modeler User Guide

781

Databases

Attribute

Data Types:
Char, NChar, NText, NVarChar, NVarChar(max), Text, VarChar, VarChar(max) - Select any of
these data types to display the Collation for the Column box.
Unique indentifier - Select this item to display the Row GUID Column checkbox.
XML - You can define details on xml attribute on tab XML Data Type Properties.

Toad Data Modeler User Guide

782

Databases

Computed Column - It is not a data type. Select this item if you want to set column as computed.
Default rule Is Default Object - Select this checkbox to bind default rule (known as default
object in MS SQL Server) to attribute.
Rule Object - Select a rule object that will be bound to attribute.
Example: See the Identity tab of attribute

Toad Data Modeler User Guide
Databases

Key

Take notice of the Data Space area. If you click Filegroup, list of file groups will become
available. If you select Partition Scheme, schemes will be available.

Index Options Tab
Detailed settings for index of the key should be defined here.

783

Toad Data Modeler User Guide
Databases

784

Toad Data Modeler User Guide
Databases

Relationship

785

Toad Data Modeler User Guide
Databases

Index

786

Toad Data Modeler User Guide
Databases

Index Options Tab
Detailed settings of the index should be defined here.

787

Toad Data Modeler User Guide
Databases

788

Toad Data Modeler User Guide

789

Databases

Trigger

CLR Trigger - If you select this checkbox, you can define CLR trigger on tab CLR Trigger.

Toad Data Modeler User Guide

790

Databases

Dictionary Type

Here, you can enter alias data types.
Default Object - Select a default object that will be bound to dictionary type (alias data
type in MS SQL).
Rule Object - Select a rule object that will be bound to dictionary type (alias data type
in MS SQL).

Toad Data Modeler User Guide
Databases

User Data Type

Here, you can enter CLR user-defined types.

791

Toad Data Modeler User Guide
Databases

Domain

In domain for SQL Server 2005, you can define:
l

XML data type properties for XML data type

l

Computed column expression (select Comuped Column item from Data Type box)

l

Collation for character data types

792

Toad Data Modeler User Guide
Databases

View

793

Toad Data Modeler User Guide
Databases

794

Toad Data Modeler User Guide

795

Databases

Procedure

Types of Stored Procedure:
l

Stored Procedure

l

CLR Stored Procedure

l

Extended Stored Procedure

For the selected type, appropriate tab will appear in the Stored Procedure Properties dialog.

Toad Data Modeler User Guide
Databases

Functions

Types of functions:
l

Scalar Function

l

Table Valued Function

l

CLR Scalar Function - Appropriate options and tab will appear.

l

CLR Table Valued Function - Appropriate tab will appear in the dialog.

l

Aggregate Function

Select a type and see the options that display then.

796

Toad Data Modeler User Guide
Databases

Defaults
If you want to generate default as default object, you have to select Generate checkbox.

Check Constraint Rules
If you want to generate check constraint rule as rule object, you have to select
Generate checkbox.

Synonym

If you want to enter object that is not in the Object box, select Base Object is not in List
checkbox and enter the object in the new Base Object box.

797

Toad Data Modeler User Guide
Databases

Script Generation - Microsoft SQL Server 2005

798

Toad Data Modeler User Guide

799

Databases

Note: To generate the table, column descriptions for SQL Server db in Toad Data Modeler,
schema/owner has to be defined. Please see the Entity Properties form | General tab and from
the Schema box select a schema or click the icon on the right to open the Schema dialog and
define a new schema, then select it for the entity.

Extra Objects - Microsoft SQL Server 2005
See the extra objects in Model Explorer:

Toad Data Modeler User Guide
Databases

l

Partition Functions

l

Partition Schemes

l

Filegroups

l

XML Schema Collections

l

Fulltext Catalogs

l

Assemblies

Example of Partition Function:

Example of Fulltext Catalog:

800

Toad Data Modeler User Guide

801

Databases

Note: Filegroup and Path parameters are used only in Microsoft SQL Server 2005.
If you want to write complete DDL statement for fulltext catalog, select Generate SQL Only
checkbox and write the statement to SQL tab that will display then.

Microsoft SQL Server 2008
Reverse Engineering - Microsoft SQL Server 2008
New Connection
Click File | Reverse Engineering | Connections...

Toad Data Modeler User Guide

802

Databases

To create new database connection
Click the New Connection icon on toolbar (first icon on the Connections form toolbar). Define
new Connection Name.
Select target database platform.

Choose connection method and specify details.

Select object types you wish to work with.

Toad Data Modeler User Guide

803

Databases

In section Options specify detailed settings for reverse engineering tasks.

Load Permissions - Only permissions to views, tables, columns and functions are loaded during
reverse engineering. Permissions to users, schemas and user groups are not loaded (they can be
only generated in SQL script.)
Click Finish to confirm new database connection settings.
To test database connection
Click the Test Connection icon on toolbar.

Toad Data Modeler User Guide

804

Databases

Reverse Engineering
To create a new model
Select existing connection and click Create New Model from Database

Choose User/Schema and select items you wish to reverse engineer. Make sure you select Tables,
Views, Procedures and Functions (Types of objects can be defined during Connection creation).

Toad Data Modeler User Guide

805

Databases

Click Execute to create new model.
Result:

Note: Comments on views and their columns are reversed. Comments on views are stored in the
View Properties dialog | Description tab. Comments on view columns are loaded to View
Properties dialog | After Script tab (if you want to create them during model creation, you need
to enter them manually - and in this form: --comment and/or /*comment*/.

Toad Data Modeler User Guide

806

Databases

Related Topics
Create New Model from Database - Reverse Engineering (page 255)

Specifics - Microsoft SQL Server 2008
Microsoft SQL Server 2008 R2 is also supported (Reverse Engineering, Import DDL, LIVE RE,
DDL/SQL Script generation, Model Verification, Reports, Alter Script generation; descriptions
(extended property MS_Description) for procedures and functions).
Entity

Description Tab
The description text is generated in final DDL script.
Note: To generate the table, column descriptions for SQL Server db in Toad Data Modeler,
schema/owner has to be defined. Please see the Entity Properties form | General tab and from
the Schema box select a schema or click the icon on the right to open the Schema dialog and
define a new schema, then select it for the entity.

Toad Data Modeler User Guide
Databases

Data Compression tab

807

Toad Data Modeler User Guide
Databases

Fulltext Index tab

808

Toad Data Modeler User Guide

809

Databases

Attribute

New data types:
- data types of type DATE: date, datetime2, datetime2(x), datetimeoffset, datetimeoffset(x),
time, time(x).
- spatial data types: geometry, geography.
- other data types: hierarchyid.

Toad Data Modeler User Guide

810

Databases

Note: Rowversion is generated instead of data type timestamp (they are synonyms and it is
recommended to use rowversion).
The Filestream checkbox is displayed only for data type varbinary(max).
The Sparse checkbox is not available for the following data types: geography, geometry, image,
ntext, text, timestamp, user-defined data types, computed column.
Default rule Is Default Object - Select this checkbox if you want to bind default rule (known as
default object in MS SQL Server) to attribute.
Rule Object - Select a rule object that will be bound to attribute.

Index

The FilestreamFilegroup box is available only for Clustered indexes - see the Data Space area.
In tables that are not partitioned, you can make selection from a new list FilestreamFilegroup.
In partitioned tables, you can make selection from a new list PartitionScheme.

Toad Data Modeler User Guide

811

Databases

Note: To be able to define Filestream Filegroup, the database requires columns with the
Filestream property in a table.
Possibility to define Filtered Index in the Expression for Filtered Index (WHERE) box.
Data Compression Tab

On this tab, you can set Data Compression either for all indexes (combo box "Compression
Type") or for particular partitions. (To accomplish this, it is necessary to select checkbox Set
Compression Type on Individual Partitions and fill out the box in the Set Compression Type
on Individual Partitions area. See the auxiliary combo box Compression Type for Partition,
box Partition Number and button Add to List).

Toad Data Modeler User Guide
Databases

Secondary XML Index Parameters Tab

812

Toad Data Modeler User Guide

813

Databases

Spatial Index Parameters Tab

Notes:
Now index can be generated as normal (relational) index, primary XML index, secondary XML
index and Spatial index. What index will be generated is selected automatically by the
following conditions (particularly by data type of particular attribute):
l

If index has only one column and this column is of XML type, XML index will be
generated. For the XML index it is searched whether the box "Primary XML index..." is
filled out. If it is filled out, then it is a secondary XML index. Otherwise it is a
primary XML index.

l

If index has only one column and this column is of Geometry or Geography type, Spatial
index will be generated then.

l

Database requires a primary key in a table if Spatial Index exists. User has to arrange
it on his own.

Toad Data Modeler User Guide

814

Databases

Key
Data Compression Tab

On the Data Compression tab, you can set Data Compression either for all key (combo box
Compression Type) or for particular partitions. (To accomplish this, it is necessary to select
checkbox Set Compression Type on Individual Partitions and fill out the box in the Set
Compression Type on Individual Partitions area. See the auxiliary combo box Compression
Type for Partition, box Partition Number and button Add to List).
Note: To load Data Compression defined in index during reverse engineering, it is necessary
to select the Load Index Options checkbox in the Reverse Engineering Wizard (it is selected
by default).
General tab - take notice of the Data Space area. If you click Filegroup, list of file groups will
become available. If you select Partition Scheme, schemes will be available.
Index Options tab - Detailed settings for index of the key should be defined here.

Toad Data Modeler User Guide
Databases

View

815

Toad Data Modeler User Guide

816

Databases

User Data Type

When you select TABLE type, the User-Defined Table Type Definition window will display.
Here, write the text that is defined in syntax in brackets after AS TABLE, for example "a int, b
int" (without the quotation marks).
Note: Although this type is available in attributes, it is not possible to use it there.
When you click the Generate SQL Only checkbox, the SQL tab will display.

Toad Data Modeler User Guide

817

Databases

Function

When you select the CLR Table-valued Function, the Order (List of Column Names) box will
become available. Here, you can define order (column names should be separated by commas).
When you select the Aggregate Function, you can write more input parameters separated by
comma to the List of Arguments box.

Toad Data Modeler User Guide
Databases

Script Generation - Microsoft SQL Server 2008

818

Toad Data Modeler User Guide

819

Databases

Extra Objects - Microsoft SQL Server 2008
See the extra objects in Model Explorer:
l

Filegroups

l

Partition Schemes

l

FilestreamFilegroups - Similarly to Filegroups, FilestreamFilegroups work in Toad Data
Modeler 3.xonly as a list. During script generation, the FilestreamFilegroups definition is

Toad Data Modeler User Guide

820

Databases

not generated and during reverse engineering the definition is not loaded either (only
names are loaded).
l

Stoplists - Similarly to Filegroups, Stoplists work in Toad Data Modeler 3.x only as a list.
During script generation, the Stoplist definition is not generated and during reverse
engineering the definition is not loaded either (only names are loaded).

l

Partition Functions

l

Fulltext Catalogs

l

XML Schema Collections

l

Assemblies

Example of Fulltext Catalog:

If you want to write complete DDL statement for fulltext catalog, select Generate SQL Only
checkbox and write the statement to SQL tab that will display then.

Toad Data Modeler User Guide

821

Databases

Microsoft SQL Server 2012
Extra Objects - Microsoft Server SQL 2012
See the extra objects in the Model Explorer:
l

Sequence

l

Search Property List

l

FileTable

l

Filegroups

l

Partition Schemes

l

FilestreamFilegroups - Similarly to Filegroups, FilestreamFilegroups work in Toad Data
Modeler 3.xonly as a list. During script generation, the FilestreamFilegroups definition is
not generated and during reverse engineering the definition is not loaded either (only
names are loaded).

l

Stoplists - Similarly to Filegroups, Stoplists work in Toad Data Modeler 3.x only as a list.
During script generation, the Stoplist definition is not generated and during reverse
engineering the definition is not loaded either (only names are loaded).

l

Partition Functions

l

Fulltext Catalogs

l

XML Schema Collections

l

Assemblies

Script Generation - Microsoft SQL Server 2012

Toad Data Modeler User Guide
Databases

822

Toad Data Modeler User Guide
Databases

823

Toad Data Modeler User Guide
Databases

Specifics - Microsoft SQL Server 2012
Entity

Fulltext Index tab, new combo box Search Property List.

824

Toad Data Modeler User Guide
Databases

SearchPropertyList object has only listing function- not possible to define it
(CREATE/DROP/ALTER not supported).

825

Toad Data Modeler User Guide

826

Databases

New Columnstore Index type available through a new combo box Type of Index. Options are
Relational, XML, Spatial, Columnstore and default/Not Specified.
For Columnstore indexes, many options are available, though they are not valid and they do not
get generated.

New Spatial Tessalation Scheme combo box with new options GEOMETRY_AUTO_GRID and
GEOGRAPHY_AUTO_GRID. Based on selection, further Bounding Box and Grids options are
enabled or disabled.
Cells Per Object— default value changed to empty from 16.

Toad Data Modeler User Guide
Databases

With Append option is not available now and checkbox was removed from trigger.

827

Toad Data Modeler User Guide

828

Databases

New File Table object is available.
l

Keys can be defined in text in the Keys tab (ALTER TABLE tablename ADD
UNIQUE (attr)).

l

Indexes can be defined in text in the Indexes tab (CREATE INDEX ...).

l

Triggers can be defined in text in the Triggers tab (CREATE TRIGGER ...).

l

Permissions can be defined in text in the Permissions tab (GRANT ...).

l

Comments can be defined in the Description tab.

l

In case the user wants to define checkconstraints in text, AfterScript tab can be used.

l

In case the user wants to define foreign keys in text, AfterScript tab can be used.

Toad Data Modeler User Guide
Databases

829

Toad Data Modeler User Guide

830

Databases

Sequence

Define Data Type in Data Type for Sequence Value field.
Available data types are tinyint, smallint, int, bigint, decimal and numeric with a scale of 0.
Allowed is also any user-defined data type (alias type) that is based on one of the allowed types.

Toad Data Modeler User Guide
Databases

MySQL 5.0
Extra Objects - MySQL 5.0
See the extra object in Model Explorer:
l

Databases

831

Toad Data Modeler User Guide

832

Databases

Specifics - MySQL 5.0
Entity

For Row Format item, it's possible to select some of these options:
l

Default

l

Dynamic

l

Fixed

l

Compressed

l

Redundant

l

Compact

Properties Character Set and Collation must be identical for parent and child tables provided
that at least one parent attribute is of a text data type. If the properties are not identical, a
warning message is returned during model verification.

Toad Data Modeler User Guide

833

Databases

Comment Tab
The text written on this tab is generated in final DDL script.

Attribute

Model Conversion from MySQL to MSSQL and Oracle
MySQL Enum data type is converted to Char data type, a check constraint for the attribute is
created, the parameter is preserved (see the SQL tab of the Check Constraint Properties dialog).

Toad Data Modeler User Guide
Databases

Comment Tab
The text is generated in final DDL script.

Key

Relationship
Foreign keys are supported only by tables of the InnoDB type.

834

Toad Data Modeler User Guide
Databases

Index

The following types of indexes are supported:
l

Default

l

BTREE

l

HASH

Fulltext indexes are supported only by tables of type MyISAM.

835

Toad Data Modeler User Guide
Databases

Trigger

Trigger Event options:
l

INSERT

l

UPDATE

l

DELETE

Trigger Time options:
l

BEFORE

l

AFTER

836

Toad Data Modeler User Guide

837

Databases

Other Notes
In MySQL 5, User Data Types and Dictionary types are not available.

Script Generation - MySQL 5.0

See the property Definer on tab What to Generate, under Entities/Triggers, Views,
Procedures, Functions.
During reverse engineering, the Definer property is loaded. Nevertheless, if user does not have
particular permissions, the generated DDL script with the Definer property would not work. Now
it is possible to deselect this property for the DDL script generation.
Important note:

Toad Data Modeler User Guide

838

Databases

l

In new MySQL models created in Toad Data Modeler 3.5.10, the Definer property
is selected.

l

If you open your MySQL model created in any older Toad Data Modeler version, the
Definer property will be unselected in the DDL Script Generation dialog and therefore
will not be generated in DDL script.

MySQL 5.1
Extra Objects - MySQL 5.1
See the extra object in Model Explorer:
l

Databases

Toad Data Modeler User Guide

839

Databases

Specifics - MySQL 5.1
Entity

On the Partition Options tab, you can write SQL code to create partition. The partition will be
generated in SQL code as well as in reports.
See the SQL Preview tab:

Toad Data Modeler User Guide
Databases

840

Toad Data Modeler User Guide

841

Databases

Properties Character Set and Collation must be identical for parent and child tables provided
that at least one parent attribute is of a text data type. If the properties are not identical, a
warning message is returned during model verification.

Toad Data Modeler User Guide

842

Databases

Script Generation - MySQL 5.1

See the property Definer on tab What to Generate, under Entities/Triggers, Views,
Procedures, Functions.
During reverse engineering, the Definer property is loaded. Nevertheless, if user does not have
particular permissions, the generated DDL script with the Definer property would not work. Now
it is possible to deselect this property for the DDL script generation.
Important note:
l

In new MySQL models created in Toad Data Modeler 3.5.10, the Definer property
is selected.

l

If you open your MySQL model created in any older Toad Data Modeler version, the
Definer property will be unselected in the DDL Script Generation dialog and therefore
will not be generated in DDL script.

Toad Data Modeler User Guide
Databases

MySQL 5.5
Extra Objects - MySQL 5.5
See the extra object in Model Explorer:
l

Databases

Reverse Engineering - MySQL 5.5
New Connection
Click File | Reverse Engineering | Connections...

843

Toad Data Modeler User Guide

844

Databases

To create new database connection
Click the New Connection icon on toolbar (first icon on the Connections form toolbar). Define
new Connection Name.
Select target database platform.

Choose connection method and specify details.

Toad Data Modeler User Guide
Databases

Select object types you wish to work with.

In section Options specify detailed settings for reverse engineering tasks.

845

Toad Data Modeler User Guide
Databases

Click Finish to confirm new database connection settings.
To test database connection
Click the Test Connection icon on toolbar.

Reverse Engineering
To create a new model
Select existing connection and click Create New Model from Database

846

Toad Data Modeler User Guide

847

Databases

Select items you wish to reverse engineer. Make sure you select Tables, Views, Procedures and
Functions (Types of objects can be defined during Connection creation).

Click Execute to create new model.

Toad Data Modeler User Guide
Databases

Result:

Script Generation - MySQL 5.5
See Script Generation - MySQL 5.1 (page 842)

Specifics - MySQL 5.5
Index Properties
l

Support for Index Comments (tab Comments added in the Index Properties dialog)

Oracle 9i
Extra Objects - Oracle 9i
See the extra object in Model Explorer:
l

Tablespaces

l

Java

848

Toad Data Modeler User Guide

849

Databases

Specifics - Oracle 9i
See "Specifics - Oracle 10g" (page 863) for more information. The specifics of these two
databases are similar.

Script Generation - Oracle 9i

Change in Toad Data Modeler v. 3.5
Automatically generated trigger (trigger for an attribute sequence – see the Attribute Properties
dialog | General tab | Used Sequence/Trigger box) is now generated as a standard trigger (e.g.
entity trigger).

Toad Data Modeler User Guide
Databases

This trigger is generated provided that the Triggers item is selected in the DDL Script
Generation dialog | What to Generate tab. Now it is NOT necessary to select also the
Entity item.
In the past, this trigger was generated only provided that the Entities item was selected (the
Triggers item was not taken into consideration).

Oracle 10g
Extra Objects - Oracle 10g
See the extra object in Model Explorer:
l

Sequences

l

Packages

l

Directories

l

Tablespaces

l

ExtraObjects

l

Java

Example of Sequence and Directory:

850

Toad Data Modeler User Guide
Databases

851

Toad Data Modeler User Guide
Databases

852

Toad Data Modeler User Guide

853

Databases

Java

Support for Oracle Java Source, including reverse engineering:
All the three types of Java schema objects (SOURCE, CLASS, RESOURCE) should be written to
this object. - During reverse engineering only SOURCE types are loaded, and from them only
sequences of characters for Java source. Other Java schema objects (CLASS, RESOURCE) are
loaded only as a name. Checkbox Generate is unselected for all the Java schema objects
(SOURCE, CLASS, RESOURCE).

Reverse Engineering - Oracle 10g
New Connection
Click File | Reverse Engineering | Connections...

Toad Data Modeler User Guide

854

Databases

To create new database connection
Click the New Connection icon on toolbar (first icon on the Connections form toolbar). Define
new Connection Name.

Select target database platform.

Toad Data Modeler User Guide
Databases

Choose connection method and specify details.

Select object types you wish to work with.

855

Toad Data Modeler User Guide
Databases

In section Options specify detailed settings for reverse engineering tasks.

856

Toad Data Modeler User Guide
Databases

Click Finish to confirm new database connection settings.
To test database connection
Click the Test Connection icon on toolbar.

857

Toad Data Modeler User Guide

858

Databases

Notes:
l

For support of unicode, select native or TCP/IP connection.

l

Oracle Instant Clients support- TDM can load all registry entries of Oracle
clients (both 32-bit and 64-bit), if there is any installed.
In case a user isn't installing the client but only copying the client's folder,
then the user has to insert a path to the client (OCl.dll) into windows
variable PATH.
If this path is the first of all the available clients, TDM will find it.

l

tnsnames.ora- in Settings | Options | Model | Oracle a user can select
tnsnames.ora file to be used in case no other has been found for the client.
The order of searching is: Registry - Windows Variable - default directory directory set in TDM

Reverse Engineering
To create a new model
Select existing connection and click Create New Model from Database

Choose User/Schema and select items you wish to reverse engineer. Make sure you select Tables,
Views, Procedures and Functions (Types of objects can be defined during Connection creation).

Toad Data Modeler User Guide
Databases

Click Execute to create new model.
Result:

859

Toad Data Modeler User Guide
Databases

Notes:
1. If the following error message occurs in the Log area: "Unable to reverse
users, roles and permissions. You haven't assigned the SELECT_
CATALOG_ROLE role!", it means you have not all the necessary rights to
load users, roles and permissions.
2. To load these items successfully, you need to have the SELECT_
CATALOG_ROLE role assigned or need to set a right for user to
SELECT tables DBA_USERS, DBA_ROLES, DBA_ROLE_PRIVS,
DBA_TAB_PRIVS.
3. Information on system tables to which user does not have access or
SELECT privilege will be written out in the Log area of the RE Wizard.
There can be one of the following outputs: 
a. Missing access to system table ALL_TABLES.
b. Missing privilege SELECT on system table ALL_TABLES.

860

Toad Data Modeler User Guide
Databases

Script Generation - Oracle 10g

What to Generate tab - For Entities and Materialized Views the following checkboxes are
available:

861

Toad Data Modeler User Guide

862

Databases

l

Physical Properties and Table Properties

l

Materialized View Properties

Clear the Physical Properties checkbox not to generate content of tab Physical Properties of
entities and materialized views. (For entities, content of tab External Table Properties will not
be generated either.)
Clear the Table Properties/ Materialized View Properties checkbox not to generate the content
of these tabs in entity and materialized view dialogs.

Toad Data Modeler User Guide
Databases

Specifics - Oracle 10g
Entity

863

Toad Data Modeler User Guide

864

Databases

External tables are supported. On tab Physical Properties, select the External Table
(Organization External) checkbox. The External Table Properties tab will occur on the form.

Toad Data Modeler User Guide
Databases

865

Toad Data Modeler User Guide
Databases

Attribute

Data Types:
For Char and Varchar2 data types, you can define Column Length in.
For User data type, you can define REF options.
Note:

866

Toad Data Modeler User Guide

867

Databases

Change for CHAR/BYTE of attributes: Previously, it was necessary to select CHAR or BYTE for
Char(x) and Varchar(x) data types of attribute (domain) in Column Length in combo box. Now
there is a new item "Default" that is selected by default.
Reverse engineering: During RE TDM finds out what is the default item in the Oracle database.
Example: BYTE is a default item in Oracle database.
- Previous behavior: BYTE was loaded for the attribute.
- Current behavior: “Default” item is shown for the attribute. BYTE will be shown in Model
Properties dialog | Database Parameters tab | Length Semantics box (it is not used during script
generation).
If you want to preserve the previous behavior of TDM, select the "Load CHAR/BYTE to
Attributes Regardless Database Default Settings" checkbox in the RE Wizard.
Used Sequence (trigger) - From this box, you can select a sequence that you want to use for the
attribute. (A new trigger will be created in SQL script.)
Encryption Specification - Here, you can write e.g. USING 'AES192' NO SALT.
Note: If Not Null checkbox is selected, properties of Not Null constraint can be defined on tab
Not Null Constraint.

Toad Data Modeler User Guide
Databases

Keys

868

Toad Data Modeler User Guide

869

Databases

Relationship

Create Index to Foreign Key - Select this checkbox to display a new tab Index to Foreign Key
in the dialog.

Index
Example of Expression index:

Toad Data Modeler User Guide
Databases

Example: Index properties (for domain index):

870

Toad Data Modeler User Guide
Databases

871

Toad Data Modeler User Guide
Databases

Trigger

872

Toad Data Modeler User Guide
Databases

873

Toad Data Modeler User Guide

874

Databases

User Data Type

When you select Varray Type or Nested Table Type, a new tab displays (Varray Type tab or
Nested Table Type tab). There, you can see new boxes* where you write appropriate values.
Click Create Definition and the definition will be written in the memobox.
*Note: The content of the boxes is not saved and is not used for reverse engineering, script or
report generation.
Tip: Hints in memoboxes for User Data Types are shown.

Toad Data Modeler User Guide
Databases

View

875

Toad Data Modeler User Guide
Databases

876

Toad Data Modeler User Guide
Databases

Materialized View

877

Toad Data Modeler User Guide
Databases

878

Toad Data Modeler User Guide
Databases

Procedure

879

Toad Data Modeler User Guide
Databases

880

Toad Data Modeler User Guide
Databases

Function

881

Toad Data Modeler User Guide
Databases

882

Toad Data Modeler User Guide
Databases

Synonym

Other Notes
l

Dictionary types are not supported for Oracle models.

l

See "User Data Types" (page 141) for more information on user data types in
Oracle model.

Oracle 11g Release 1
Extra Objects - Oracle 11g Release 1
See the extra objects in Model Explorer:

883

Toad Data Modeler User Guide
Databases

l

Sequences

l

Packages

l

Directories

l

Tablespaces

l

ExtraObjects

l

Java

Script Generation - Oracle 11g Release 1

884

Toad Data Modeler User Guide
Databases

Specifics - Oracle 11g Release 1
Attribute

Virtual Column area - If you want the column to be virtual column, select the Is Virtual
Column checkbox and fill out the Expression box (e.g. Attribute2 * Attribute3) and set
appropriate data type.

885

Toad Data Modeler User Guide
Databases

Index

886

Toad Data Modeler User Guide

887

Databases

Trigger (Entity)

The Trigger Fire box with an item COMPOUND.
Body of Compound Trigger, including initial key sentence "COMPOUND TRIGGER", should
be written on tab SQL.
From the Trigger Fire box, you can select items COMPOUND or BEFORE or AFTER.

Toad Data Modeler User Guide
Databases

Trigger (View)

From the Trigger Fire box, you can select items COMPOUND or INSTEAD OF.

Other Notes
Dictionary types are not supported for Oracle models.

888

Toad Data Modeler User Guide
Databases

Oracle 11g Release 2
Extra Objects - Oracle 11g Release 2
See the extra objects in Model Explorer:
l

Edition

l

Sequences

l

Packages

l

Directories

l

Tablespaces

l

ExtraObjects

l

Java

Edition

889

Toad Data Modeler User Guide

890

Databases

The Edition object can be generated in DDL script and also loaded during reverse engineering.
The following objects can refer to the extra object Edition:
Synonym, View, Function, Procedure, Package, Type, Trigger. See their Properties dialog and
the new tab Edition | In Edition box.
Edition - Reverse Engineering
RE Wizard | page Options| checkbox Load Objects* Only from Selected Edition: and a box
where you can type name of the Edition from which you want to load objects. During RE, all
objects to which the defined edition refers are loaded. In the reversed model, the Edition is
written on tab Edition in the Properties dialogs of these objects that have been newly defined or
modified in the database for the Edition typed in the box.
Edition - DDL Script Generation
DDL Script Generation dialog | Detail Settings tab | checkbox Generate Change of Edition in
Session. Select this checkbox if you want Toad Data Modeler to take into account for the script
generation an edition defined on tab Edition in Properties dialog of particular object.
Example of what will be generated in DDL script:
Before object definition:
ALTER SESSION SET EDITION = object_edition
After object definition:
ALTER SESSION SET EDITION = ora$base
Note: This is an example of default edition ora$base. Default edition is defined in Model |
Model Properties dialog | Database Parameters tab | Default Edition Name box.

Toad Data Modeler User Guide
Databases

Script Generation - Oracle 11g Release 2

891

Toad Data Modeler User Guide

892

Databases

What to Generate tab - For Entities and Materialized Views the following checkboxes are
available: 
l

Physical Properties and Table Properties

l

Materialized View Properties

Clear the Physical Properties checkbox not to generate content of tab Physical Properties of
entities and materialized views. (For entities, content of tab External Table Properties will not
be generated either.)
Clear the Table Properties/ Materialized View Properties checkbox not to generate the content
of these tabs in entity and materialized view dialogs.
On tab What to Generate see the Editions object.
User Data Types - Click the Extended Values column and see option CREATE OR
REPLACE ... FORCE.
Note: The option is used for CREATE OR REPLACE type. It permits to overwrite a type on
which another type depends. If only CREATE OR REPLACE is selected, it leads to error
notification.

Toad Data Modeler User Guide

893

Databases

Detail Settings tab | checkbox Generate Change of Edition in Session. Select this checkbox if
you want Toad Data Modeler to take into account for the script generation an edition defined on
tab Edition in Properties dialog of particular object.
Example of what will be generated in DDL script:
Before object definition:
ALTER SESSION SET EDITION = object_edition
After object definition:
ALTER SESSION SET EDITION = ora$base
Note: This is an example of default edition ora$base. Default edition is defined in Model |
Model Properties dialog | Database Parameters tab | Default Edition Name box.

Toad Data Modeler User Guide
Databases

Specifics - Oracle 11g Release 2
View

New parameter Editioning - Edition View checkbox.
Restriction area - You can define a constraint for restriction READ ONLY or WITH
CHECK OPTION.

894

Toad Data Modeler User Guide

895

Databases

The following objects can refer to the extra object Edition:
Synonym, View, Function, Procedure, Package, Type, Trigger. See their Properties dialog and
the new tab Edition | In Edition box.
See "Extra Objects - Oracle 11g Release 2" (page 889) for more information.

Toad Data Modeler User Guide

896

Databases

Trigger (Entity)

Parameter CROSSEDITION - Select the Crossedition Trigger checkbox to display a combo-box
with options Not Specified, Forward Crossedition, Reverse Crossedition.
Besides the parameter FOLLOWS, there is a parameter PRECEDES - Trigger Ordering area. The
Type combo-box offers options Follows or Precedes. In the Trigger List box, you can write a
list of triggers (e.g. triggername1, triggername2).

Toad Data Modeler User Guide

897

Databases

Trigger (View)

From the Trigger Fire box, you can select items COMPOUND, INSTEAD OF, BEFORE
and AFTER.
Column List edit box is available when Update checkbox is selected in Trigger Events section
and Trigger Fire option is set to either COMPOUND, AFTER or BEFORE.
For Each Row checkbox and When Condition edit box are enabled based on Trigger Fire
option selected.

Toad Data Modeler User Guide

898

Databases

PostgreSQL 8.1
Extra Objects - PostgreSQL 8.1
See the extra object in Model Explorer:
l

Tablespaces

l

Aggregates

l

Sequences

l

Rewrite Rules

Specifics - PostgreSQL 8.1
See "Specifics - PostgreSQL 8.2" (page 903) for more information. The specifics of these two
databases are similar.
Important Note: In PostgreSQL database, Users are not supported (only User Groups). To User
Groups, roles should be written.

Toad Data Modeler User Guide
Databases

Script Generation - PostgreSQL 8.1

PostgreSQL 8.2
Extra Objects - PostgreSQL 8.2
See the extra object in Model Explorer:

899

Toad Data Modeler User Guide
Databases

l

Tablespaces

l

Aggregates

l

Sequences

l

Rewrite Rules

Aggregate

900

Toad Data Modeler User Guide
Databases

Sequence

901

Toad Data Modeler User Guide

902

Databases

Rewrite Rule

In the Rule Properties dialog, you can select whether the rule relates to view or entity.
In reports, Rewrite Rules will be generated for entities and views provided that the Rewrite
Rules, Entities and/or Views checkboxes are all selected in OTPs (page What to Report in the
Report Wizard).
During reverse engineering only those Rewrite Rules that relate to the loaded entities and views
will be reversed.

Toad Data Modeler User Guide
Databases

Specifics - PostgreSQL 8.2
Entity

903

Toad Data Modeler User Guide
Databases

Attribute

904

Toad Data Modeler User Guide
Databases

Key

905

Toad Data Modeler User Guide
Databases

Relationship

906

Toad Data Modeler User Guide
Databases

Index

Index Access Methods:
l

btree

l

hash

l

gist

l

gin

907

Toad Data Modeler User Guide
Databases

Trigger

908

Toad Data Modeler User Guide
Databases

Dictionary Type

Is Array Type checkbox is selected.

909

Toad Data Modeler User Guide
Databases

Here, you can enter PostgreSQL domains.

910

Toad Data Modeler User Guide
Databases

User Data Type

Here, you can enter Composite Types and Base Types.

911

Toad Data Modeler User Guide
Databases

Function

912

Toad Data Modeler User Guide
Databases

913

Toad Data Modeler User Guide
Databases

Schema

Other Notes
In PostgreSQL database, Users are not supported (only User Groups). To User Groups, roles
should be written.

Script Generation - PostgreSQL 8.2

914

Toad Data Modeler User Guide
Databases

PostgreSQL 8.3
Extra Objects - PostgreSQL 8.3
See the extra object in Model Explorer:
l

Tablespaces

l

Aggregates

915

Toad Data Modeler User Guide
Databases

l

Sequences

l

Rewrite Rules

For more info see Extra Objects - PostgreSQL 8.2 (page 899)

916

Toad Data Modeler User Guide

917

Databases

Specifics - PostgreSQL 8.3
Attribute

PK Attributes of type Array: Information on Array type migrates together with the PK attribute
during creation of relationship.

Toad Data Modeler User Guide

918

Databases

Function

Parameters Cost, Rows, Set. Set parameter can be defined by the ALTER FUNCTION command
written to After Script section. Here it will be also loaded during reverse engineering. Example
of ALTER FUNCTION:
ALTER FUNCTION myfunc(integer, integer) SET DateStyle=postgres, dmy;
Notes:
1. During script generation, default values of parameters Cost and Rows are not generated
(default for Rows is 1000, default for Cost is 1 for c/internal language and 100 for other
languages).
2. Note from a manual: Rows is only allowed when the function is declared to return a set.

Toad Data Modeler User Guide

919

Databases

User Data Types

Possibility to define Enumerated Type - see the new data type in the Type box and new tab
Enumerated Type where this data type should be defined (example: 'item1', 'item2', 'item3').
Note: In previous version, it was possible to define only Composite Type and Base Type.
User Data Types of the Base Type tab (User-defined type in manual) can have (for example
while using attributes) modifiers - e.g. user_type(20,5). In previous version, modifiers could have
only inbuilt/basic data types (types varchar(40) or number(20,5)).
Notes:

Toad Data Modeler User Guide

920

Databases

1. When you select the Base Type from the Type box, new boxes Name of Parameter and
Default Value of Parameter will display. Name of Parameter - when you select an
attribute with selected User Data Type, a box with an option to define parameters will
display. Default Value of Parameter is just an instrument and is not generated.
2. When there is a possibility to define more modifiers for a Base Type, such User Data
Type used in an attribute will be written to appropriate parameter in the Attribute
Properties dialog e.g. as: "30,20,5". During reverse engineering only Typmod will be
loaded. Typmod is a number where the parameters are coded. If user needs to decode the
Typmode during reverse engineering, function ParseTypmod(Length, format_type) in
script REDataMigratorDBPG83 should be overwritten. If one modifier is used during
reverse engineering, everything will be loaded properly.
3. Modifiers of Base Type can be used in: attributes, composite type attributes, dictionary
types (in PostgreSQL called Domains) and in TDM domains.

Toad Data Modeler User Guide

921

Databases

The Base Type tab - two new parameters "Type Modifier Input Function" and "Type Modifier
Output Function" for support of modifiers. (Thanks to these new parameters, Base Types can also
use modifiers.)

Script Generation - PostgreSQL 8.3

Toad Data Modeler User Guide
Databases

PostgreSQL 8.4
Extra Objects - PostgreSQL 8.4
See the extra object in Model Explorer:
l

Tablespaces

l

Aggregates

l

Sequences

l

Rewrite Rules

For more info see Extra Objects - PostgreSQL 8.2 (page 899)

Specifics - PostgreSQL 8.4
Entity

922

Toad Data Modeler User Guide

923

Databases

On tab Storage Parameters you can define new storage parameters for property Autovacuum.
Other parameters for Toast tables can be defined on tab Toast Storage Parameters.

On this tab select the Use Toast Storage Parameters checkbox to activate this tab and to use
the properties defined there.
Entity Properties form | Permissions tab - New permission TRUNCATE.

Toad Data Modeler User Guide

924

Databases

Attribute

Data Types Interval and Interval(x) - New box Fields in Attribute, Domain and Dictionary Type
Properties dialogs.

Toad Data Modeler User Guide
Databases

Index

New storage parameter FASTUPDATE that can be set up via checkbox Fast Update.
From the Index Access Method box, select gin to display the Fast Update checkbox.

925

Toad Data Modeler User Guide
Databases

Trigger

926

Toad Data Modeler User Guide

927

Databases

User Data Type

Base Type (set up in User Data Type) - Parameters CATEGORY and PREFERRED
Open the User Data Type Properties dialog | Base Type tab | see the box Category Code and
checkbox Preferred Type.

Toad Data Modeler User Guide

928

Databases

Function

Parameter Window can be defined in checkbox Window Function.
During reverse engineering:
l

New argument property DEFAULT is loaded.

l

New mode of argument VARIADIC is loaded.

l

New TABLE function is taken into consideration - see the renamed box Return Data
Type / TABLE function.

Toad Data Modeler User Guide
Databases

Script Generation - PostgreSQL 8.4

Specifics - PosgreSQL 9.0
User Data Type
Enumerated type does not require any Label.

929

Toad Data Modeler User Guide

930

Databases

Entity

New combo boxTable Type available on Entity Properties dialog, tab General. WhenTyped
Tableoption is selected, new combo boxSelect Composite Type appears below the Table Type
combo box.Select Composite Type combo box lists all existing User Data Types.
Note: Make sure you select Composite type table from the combo box or run verification, which
will return an Error message in case a wrong type is used.

Toad Data Modeler User Guide
Databases

Key Properties

OptionsDeferrable andDeferred available on Key Properties dialog, tab General.

931

Toad Data Modeler User Guide

932

Databases

Trigger

NewColumn List field available for trigger event Update (Update checkbox must be checked) in
Trigger Properties dialog.
Note: Use comma (,) as a separator.
NewWhen Condition field available on Trigger Properties dialog, tab General.

Extra Objects - PostgreSQL 9.0
See the extra object in Model Explorer:

Toad Data Modeler User Guide
Databases

l

Tablespaces

l

Aggregates

l

Sequences

l

Rewrite Rules

For more info see Extra Objects - PostgreSQL 8.2 (page 899)

Script Generation - PostgreSQL 9.0

933

Toad Data Modeler User Guide

934

Databases

Specifics - PosgreSQL 9.0
User Data Type
Enumerated type does not require any Label.
Entity

New combo boxTable Type available on Entity Properties dialog, tab General. WhenTyped
Tableoption is selected, new combo boxSelect Composite Type appears below the Table Type
combo box.Select Composite Type combo box lists all existing User Data Types.
Note: Make sure you select Composite type table from the combo box or run verification, which
will return an Error message in case a wrong type is used.

Toad Data Modeler User Guide
Databases

Key Properties

OptionsDeferrable andDeferred available on Key Properties dialog, tab General.

935

Toad Data Modeler User Guide

936

Databases

Trigger

NewColumn List field available for trigger event Update (Update checkbox must be checked) in
Trigger Properties dialog.
Note: Use comma (,) as a separator.
NewWhen Condition field available on Trigger Properties dialog, tab General.

Toad Data Modeler User Guide
Databases

PostgreSQL 9.1
Extra Objects - PostgreSQL 9.1
See the extra object in Model Explorer:
l

Tablespaces

l

Aggregates

l

Sequences

l

Rewrite Rules

l

Collations

l

Foreign Tables

l

Foreign Servers

937

Toad Data Modeler User Guide
Databases

Collation

Foreign Table

938

Toad Data Modeler User Guide

939

Databases

Common entity object is used for Foreign Table object.
Foreign Servers

For more info see Extra Objects - PostgreSQL 8.2 (page 899) and Specifics - PostgreSQL
9.1 (page 941)

Toad Data Modeler User Guide
Databases

Script Generation - PostgreSQL 9.0

940

Toad Data Modeler User Guide

941

Databases

Specifics - PostgreSQL 9.1
Entity

New checkbox Unlogged added (verification changed accordingly).
Foreign Table
When Foreign Table is selected in the Table Type combobox, a new Server combobox appears
bellow it and Foreign Table Options tab is added in the Entity Properties dialog.
Foreign Table Options tab contains List of Options memobox, which should contain the part of
CREATE FOREIGN TABLE command written in brackets in OPTIONS—e.g. filename
'c:\\file.txt'.
Although common entity object is used for Foreign Table entity in Toad Data Modeler, only the
following features can be used:
l

Name

l

Schema

Toad Data Modeler User Guide
Databases

l

Attributes list

l

Comment

l

Permission

l

Foreign Server combobox

l

Foreign Table Options tab

For Attributes, only the following features can be used:
l

Name

l

Data Type

l

Null

Foreign Server

l

CREATE/DROP/ALTER are not supported

l

only a listing function

It can be used from Foreign Table, combobox Server.

942

Toad Data Modeler User Guide
Databases

Collation

l

CREATE/DROP/ALTER are not supported

l

only a listing function

943

Toad Data Modeler User Guide

944

Databases

The Collation combobox is visible only when Collation feature is enabled for the used
Data Type.
In case of:
l

Data Type— for Text, Character varying(x), Character(x), Varchar types

l

User Data Type—for Base type with checked Collatable checkbox

l

Dictionary Type—if correct Data Type or User Data Type is selected (see above)

l

Domain—combobox is disabled (changes not allowed)

Toad Data Modeler User Guide
Databases

User Data Type—Composite Type

945

Toad Data Modeler User Guide

946

Databases

COLLATE collation definition can be used for every attribute to set its Collation. To set
Collation, manually write COLLATE collation expression in Composite Type tab right after
"attributename datatypename" definition (see the screenshot above). Toad Data Modeler

will load it during RE.
No attribute is necessary for Composite Type.

Toad Data Modeler User Guide
Databases

947

Toad Data Modeler User Guide
Databases

Index

It is possible to set Collation of every column/attribute of the table.
To set Collation:
1. Check the Generate Expression checkbox.
2. In the Expression field, write e.g "atr1 COLLATE collname DESC, atr2".
Toad Data Modeler then loads this index as an expression during RE.

948

Toad Data Modeler User Guide
Databases

Relationship

Not Valid checkbox—option when adding a constraint of a foreign key.
View
Trigger for view.

949

Toad Data Modeler User Guide

950

Databases

l

INSTEAD OF UPDATE does not support columns list

l

AFTER/BEFORE UPDATE support columns list

l

if INSTEAD OF used, then FOR EACH ROW checkbox must be applied

l

if AFTER/BEFORE UPDATE used, then FOR EACH STATEMENT checkbox must
be applied

l

INSTEAD OF does not support WHEN

Toad Data Modeler User Guide

951

Databases

PostgreSQL 9.2
Extra Objects - PostgreSQL 9.2
No extra objects are implemented for PostgreSQL 9.2.
For more info see Extra Objects - PostgreSQL 8.2 (page 899), Specifics - PostgreSQL 9.1 (page
941) and Specifics - PostgreSQL 9.2 (page 956).

Reverse Engineering - PostgreSQL 9.2
New Connection
Click File | Reverse Engineering | Connections...

To create new database connection
Click the New Connection icon on toolbar (first icon on the Connections form toolbar). Define
new Connection Name.
Select target database platform.

Toad Data Modeler User Guide
Databases

Choose connection method and specify details.

Select object types you wish to work with.

952

Toad Data Modeler User Guide
Databases

In section Options specify detailed settings for reverse engineering tasks.

Click Finish to confirm new database connection settings.
To test database connection
Click the Test Connection icon on toolbar.

953

Toad Data Modeler User Guide

954

Databases

Reverse Engineering
To create a new model
Select existing connection and click Create New Model from Database

Select items you wish to reverse engineer. Make sure you select Tables, Views, Procedures and
Functions (Types of objects can be defined during Connection creation).

Toad Data Modeler User Guide
Databases

Click Execute to create new model.
Result:

955

Toad Data Modeler User Guide
Databases

Script Generation - PostgreSQL 9.2
See Script Generation - PostgreSQL 9.0 (page 940) for more information.

Specifics - PostgreSQL 9.2
Attributes - Foreign Table
Attributes can have Options specified

Resulting in:
CREATE FOREIGN TABLE "postgres"."T_CUSTOMER"(
"customer_id" Integer NOT NULL,
"name" Character varying(24) OPTIONS (columndelimiter ':'),
"address" Text
)

956

Toad Data Modeler User Guide
Databases

Functions
Leakproof checkbox on General pane .

Generated SQL:
create function add4 (integer, integer) RETURNS integer
AS 'select $1 + $2;'
LANGUAGE SQL
LEAKPROOF
RETURNS NULL ON NULL INPUT;

Index
- option spgist added in Index Access Method.
- gist index has Buffering parameter option

957

Toad Data Modeler User Guide
Databases

Table, Attribute - Check Constraint
No Inherit - allows not inherited constraints for tables and attributes

Generated SQL:
create table distributors2
(
did integer,
name varchar (40),
CONSTRAINT con1_noinh_table CHECK (did > 100 AND name <> '') NO

958

Toad Data Modeler User Guide
Databases

INHERIT
)

Type (User Data Type) - extra type Range Type is available
Data Type - smallserial and json data types are supported

SQLite 3.7
Extra Objects - SQLite 3.7
See the extra object in Model Explorer:
l

Database

l

Virtual Tables

Database

959

Toad Data Modeler User Guide

960

Databases

Serves only for listing function.
Available for Entity, View, Virtual Table and denotes to which database the object belongs.
Note: During Reverse Engineering, objects from only one database are loaded. Therefore,
database name is not loaded during Reverse Engineering.

Toad Data Modeler User Guide
Databases

Virtual Table

During Reverse Engineering, virtual table is loaded as text - CREATE VIRTUAL TABLE.

Script Generation - SQLite 3.7
Default settings of DDL Script Generation.

961

Toad Data Modeler User Guide
Databases

962

Toad Data Modeler User Guide
Databases

963

Toad Data Modeler User Guide

964

Databases

Specifics - SQLite 3.7
Though SQLite database is case insensitive, Reverse Engineering in Toad Data Modeler is case
sensitive. This leads to a problem that e.g. when a column name is "ATR" and an index is
defined with column name "Atr", the names do not get paired and an error message is thrown.
If some object name includes UTF characters, then the object does not get loaded during Reverse
Engineering.
Collation
3 built-in collating functions: BINARY, NOCASE, and RTRIM.
Defined in text in particular editbox.

Toad Data Modeler User Guide

965

Databases

Entity

Inner Script tab—e.g. for defining constraint in text. Code in Inner Script is generated in the
body of CREATE TABLE command, at the end after all attributes and constraints. During
Reverse Engineering, foreign key constraint definitions which are not possible to visualize by
relationship are loaded here.

Toad Data Modeler User Guide

966

Databases

Attribute

Autoincrement— Data Type must be set to INTEGER and the particular attribute must be in a
single-attribute primary key. Note that in SQLite syntax, Autoincrement is defined as a part of
a column constraint of a primary key statement, but in Toad Data Modeler it is set directly in
the Attribute.

Toad Data Modeler User Guide
Databases

New Other Constraints Settings tab

967

Toad Data Modeler User Guide

968

Databases

Relationship

Property MATCH is available in syntax but it is not used and therefore not supported in Toad
Data Modeler.
Relationships can be defined only by CREATE TABLE command.
It is not possible to have relationships between entities from different databases.
If a foreign key is created, it can contain a reference to a non-existing table/name. During
Reverse Engineering, thus foreign key is loaded in the Inner Script tab of the particular entity.

Toad Data Modeler User Guide

969

Databases

Note: By default, foreign keys are not supported in SQLite; they can be created but are disabled.
They can be enabled by command PRAGMA foreign_keys=ON;, but default value after SQLite
start is OFF!
Key

New Conflict Resolution Algorithm combobox.
New Items Propertiestab— define Collation for individual attributes of the key here.

Toad Data Modeler User Guide
Databases

Index

New If Not Exists checkbox.

970

Toad Data Modeler User Guide
Databases

New tab Items Properties— define Collation for individual attributes of the index here.

971

Toad Data Modeler User Guide
Databases

Trigger

New checkboxes Temporary Trigger and If Not Exists.

972

Toad Data Modeler User Guide
Databases

View Trigger has Trigger Fire combobox disabled with INSTEAD OF set.

973

Toad Data Modeler User Guide
Databases

View

974

Toad Data Modeler User Guide

975

Databases

Content of a new Limit tab is generated in script only if Generate SQL Only and SELECT in
Views as Text are not selected.
Virtual Table

Sybase ASE 12.5
Specifics - Sybase ASE 12.5
See "Specifics - Sybase ASE 15" (page 977) for more information. The specifics of these two
databases are similar.
Important Notes:

Toad Data Modeler User Guide

976

Databases

l

During import of Sybase ASE database from Toad Data Modeler 2.x , only models of
Sybase ASE 12.5.4 and Sybase ASE 15 can be imported. Toad Data Modeler 2.x models
of Sybase ASE 12.5 cannot be imported.

l

Toad Data Modeler supports only Sybase ASE 12.5.1 and the following (next) versions.

l

Encrypted Column area for Sybase ASE 12.5 model is available only for version Sybase
ASE 12.5.3 and next versions.

l

User Data Types are not supported in Sybase ASE database.

Script Generation - Sybase ASE 12.5

See Script Generation - Sybase ASE 15.5 for more information.

Extra Objects - Sybase ASE 12.5
See the extra object in Model Explorer:
l

Segments

Toad Data Modeler User Guide
Databases

Sybase ASE 15
Specifics - Sybase ASE 15
Entity

Partitions Definition - write definition of table partition on this tab.

977

Toad Data Modeler User Guide

978

Databases

Attribute

Computed Column - It is not a data type. Select this item from Data Type box if you want to set
column as computed.
Default rule Is Default Object - Select this checkbox if you want to bind default rule (known as
default object in Sybase ASE) to attribute.
Rule Object - Select a rule object that will be bound to attribute.

Toad Data Modeler User Guide

979

Databases

Encrypted Column area for Sybase ASE 15 model is available only for version Sybase ASE 15.0
ESD #2 and next versions.

Key

Toad Data Modeler User Guide
Databases

Relationship

980

Toad Data Modeler User Guide
Databases

Index

Partitions Definition - write definition of index partition on this tab.

981

Toad Data Modeler User Guide
Databases

Trigger

982

Toad Data Modeler User Guide

983

Databases

Dictionary Types

Here, you can enter user-defined data type.
Default - Select a default object that will be bound to dictionary type (user-defined data type in
Sybase ASE).
Rule - Select a rule object that will be bound to dictionary type (user-defined data type in
Sybase ASE).

Toad Data Modeler User Guide
Databases

Views

984

Toad Data Modeler User Guide
Databases

985

Toad Data Modeler User Guide

986

Databases

Procedures

Types of Stored Procedure:
l

Stored

l

Extended

For the selected type, appropriate tab will display in the Stored Procedure Properties dialog.

Toad Data Modeler User Guide
Databases

987

Toad Data Modeler User Guide
Databases

Functions

988

Toad Data Modeler User Guide

989

Databases

Defaults
If you want to generate default as default object, you have to select Generate checkbox.

Check Constraint Rules
If you want to generate check constraint rule as rule object, you have to select
Generate checkbox.

Other Notes
l

During import of Sybase ASE database Toad Data Modeler 2.x, only models of Sybase
ASE 12.5.4 and Sybase ASE 15 can be imported. Models of Sybase ASE 12.5 cannot
be imported.

Toad Data Modeler User Guide

990

Databases

l

Toad Data Modeler supports only Sybase ASE 12.5.1 and the following (next) versions.

l

User Data Types are not supported in Sybase ASE database.

Script Generation - Sybase ASE 15

See "Script Generation - Sybase ASE 15.5" (page 991) for more information.

Extra Objects - Sybase ASE 15
See the extra object in Model Explorer:
l

Segments

Sybase ASE 15.5
Extra Objects - Sybase ASE 15.5
See the extra object in Model Explorer:
l

Segments

l

Encryption Key

l

Web Service

Toad Data Modeler User Guide
Databases

Script Generation - Sybase ASE 15.5

991

Toad Data Modeler User Guide
Databases

Specifics - Sybase ASE 15.5

992

Toad Data Modeler User Guide
Databases

Entity

DML Logging combo box with default / full / minimal values.

993

Toad Data Modeler User Guide
Databases

Trigger

New inactive (informational) combo box Trigger Fire .
Trigger now available also for Views (see bellow).

994

Toad Data Modeler User Guide
Databases

995

Toad Data Modeler User Guide

996

Databases

Attribute

New combo box Encryption Key (formerly edit box) and new edit box Decrypt Default.
Computed Column - It is not a data type. Select this item from Data Type box if you want to set
column as computed.
Default rule Is Default Object - Select this checkbox if you want to bind default rule (known as
default object in Sybase ASE) to attribute.

Toad Data Modeler User Guide
Databases

Rule Object - Select a rule object that will be bound to attribute.

Encryption Keys

997

Toad Data Modeler User Guide

998

Databases

Web services

See Specifics - Sybase ASE 15 for more information on general specifics of Sybase
ASE databases.

Sybase ASE 15.7
Extra Objects - Sybase ASE 15.7
See the extra objects in the Model Explorer:
l

Segments

l

Encryption Key

l

Web Service

Toad Data Modeler User Guide
Databases

Script Generation - Sybase ASE 15.7

999

Toad Data Modeler User Guide
Databases

Specifics - Sybase ASE 15.7

1000

Toad Data Modeler User Guide
Databases

Entity

Examples:
Table Compression

1001

Toad Data Modeler User Guide
Databases

create table t01 (a varchar(50) not null, b varchar(50) not null)
with compression = none

Table Lob Compression + level
create table t02 (a varchar integer) with lob_compression = 0

Column Compressed
create table tab03 (a text not compressed)

1002

Toad Data Modeler User Guide
Databases

Attribute - Computed Column

Example:

1003

Toad Data Modeler User Guide

1004

Databases

create table tab04 (acompa as 'orderno' materialized not
compressed) with lob_compression = 5

See Sybase ASE 15 - Specifics for more information on general specifics of Sybase
ASE databases.

Sybase IQ 15.2
Extra Objects - Sybase IQ 15
Text Configuration Object

Toad Data Modeler User Guide
Databases

Database Spaces (DBSPACE (51001))

1005

Toad Data Modeler User Guide
Databases

User-Defined Messages (MESSAGE (53201))

1006

Toad Data Modeler User Guide
Databases

Script Generation - Sybase IQ 15.2

1007

Toad Data Modeler User Guide
Databases

SQL/DDL Script Generating

1008

Toad Data Modeler User Guide
Databases

Specifics - Sybase IQ 15.2
Entity

1009

Toad Data Modeler User Guide

1010

Databases

Attribute

Data types marked with '*' are system domains.
Second parameter BYTE (byte-length semantics [default]) or CHAR (character-length semantics)
are available for data types CHAR and VARCHAR.

Toad Data Modeler User Guide
Databases

Key

1011

Toad Data Modeler User Guide

1012

Databases

Relationship

It is not possible to load FOR OLAP WORKLOAD statements during reverse engineering.

Toad Data Modeler User Guide
Databases

Index

1013

Toad Data Modeler User Guide
Databases

TEXT INDEX supported – select the Is Text Index checkbox.

1014

Toad Data Modeler User Guide
Databases

Domain

1015

Toad Data Modeler User Guide
Databases

Trigger (Entity, View)

1016

Toad Data Modeler User Guide
Databases

It is possible to use also CREATE OR REPLACE TRIGGER.

View

1017

Toad Data Modeler User Guide
Databases

Procedure

It is possible to use also CREATE OR REPLACE PROCEDURE.
Type of procedure is not distinguished.

1018

Toad Data Modeler User Guide
Databases

Function

It is possible to use also CREATE OR REPLACE FUNCTION.
Type of function is not distinguished.

1019

Toad Data Modeler User Guide
Databases

Sybase SQL Anywhere 11
Extra Objects - Sybase SQL Anywhere 11
Text Configuration Object

1020

Toad Data Modeler User Guide
Databases

Database Spaces (DBSPACE (51001))

1021

Toad Data Modeler User Guide

1022

Databases

User-Defined Messages (MESSAGE (53201))

Reverse Engineering - Sybase SQL Anywhere 11
1. Select the existing connection string (previously stored as Alias), or click No Alias and
click Next.
2. Select Sybase SQL Anywhere 11 database.
3. Select a data provider: ADO or ODBC connection (the ODBC DSN is used for setting
up). Click Next.

Toad Data Modeler User Guide

1023

Databases

4. From the DSN box, select the defined data source. To define a new ODBC data source,
click Property Data Link and define the settings. Type User Name and Password and

Toad Data Modeler User Guide
Databases

click Next.

1024

Toad Data Modeler User Guide
Databases

5. Select data migrator.

1025

Toad Data Modeler User Guide

1026

Databases

6. Select what to reverse. A list of Object Types and Properties is displayed here.
(OTP)

Toad Data Modeler User Guide

1027

Databases

7. Select options.

8. Click Save to save your settings and options under a new Alias Name. Then click Next
on the RE wizard.

Toad Data Modeler User Guide

1028

Databases

9. Select Owner objects that you want to load. You can select the objects from the
Owner box and take advantage of Filter.

10. Click Execute. Confirm OK in the following message after the RE is finished
successfully.

Related Topics
Create New Model from Database - Reverse Engineering (page 255)

Toad Data Modeler User Guide
Databases

Specifics - Sybase SQL Anywhere 11
Entity

1029

Toad Data Modeler User Guide

1030

Databases

Attribute

Data types marked with '*' are system domains.
Second parameter BYTE (byte-length semantics [default]) or CHAR (character-length semantics)
are available for data types CHAR and VARCHAR.

Toad Data Modeler User Guide
Databases

Key

1031

Toad Data Modeler User Guide

1032

Databases

Relationship

Box Match Type with options Default, SIMPLE, FULL, UNIQUE SIMPLE, UNIQUE FULL.
It is not possible to reload FOR OLAP WORKLOAD during reverse engineering.

Toad Data Modeler User Guide
Databases

Index

It is not possible to reload FOR OLAP WORKLOAD during reverse engineering.
TEXT INDEX supported – select the Is Text Index checkbox.

1033

Toad Data Modeler User Guide
Databases

1034

Toad Data Modeler User Guide
Databases

Domain

1035

Toad Data Modeler User Guide
Databases

Trigger (Entity, View)

1036

Toad Data Modeler User Guide

1037

Databases

It is possible to use also CREATE OR REPLACE TRIGGER.
During reverse engineering also TSQL triggers are taken into consideration. Complete CREATE
TRIGGER command with selected GenerateSQLOnly is loaded for these triggers.

Toad Data Modeler User Guide
Databases

View

1038

Toad Data Modeler User Guide
Databases

Materialized View

1039

Toad Data Modeler User Guide
Databases

Procedure

It is possible to use also CREATE OR REPLACE PROCEDURE.
Type of procedure is not distinguished.

1040

Toad Data Modeler User Guide
Databases

Function

It is possible to use also CREATE OR REPLACE FUNCTION.
Type of function is not distinguished.

1041

Toad Data Modeler User Guide
Databases

Script Generation - Sybase SQL Anywhere 11

1042

Toad Data Modeler User Guide
Databases

1043

Toad Data Modeler User Guide
Databases

Teradata 13
Extra Objects - Teradata 13
Images

Related Topics:
Reverse Engineering - Teradata 13
Create New Model from Database - Reverse Engineering (page 255)
Script Generation - Teradata 13 (page 1045)
Specifics - Teradata 13 (page 1049)

1044

Toad Data Modeler User Guide
Databases

Script Generation - Teradata 13

1045

Toad Data Modeler User Guide
Databases

1046

Toad Data Modeler User Guide
Databases

1047

Toad Data Modeler User Guide
Databases

Related Topics:
SQL/DDL Script Generation

1048

Toad Data Modeler User Guide
Databases

Specifics - Teradata 13
Entity

1049

Toad Data Modeler User Guide
Databases

Attribute

1050

Toad Data Modeler User Guide
Databases

Relationship

Index
Primary Index is generated only as an inside create table statement.

1051

Toad Data Modeler User Guide
Databases

1052

Toad Data Modeler User Guide
Databases

1053

Toad Data Modeler User Guide
Databases

Trigger (Entity, View)

1054

Toad Data Modeler User Guide
Databases

View

1055

Toad Data Modeler User Guide
Databases

Materialized View

1056

Toad Data Modeler User Guide
Databases

Procedure

1057

Toad Data Modeler User Guide
Databases

Function

Related Topics:
Extra Objects - Teradata 13 (page 1044)
Reverse Engineering - Teradata 13

1058

Toad Data Modeler User Guide

1059

Databases

Script Generation - Teradata 13 (page 1045)

Supported Data Types
The list of data types supported in Toad Data Modeler is available in the Model menu | Model
Items |Data Types.

Appendix: Contact Quest
Contact Quest Support
Quest Support is available to customers who have a trial version of a Quest product or who have
purchased a Quest product and have a valid maintenance contract. Quest Support provides
unlimited 24x7 access to Support Portal at www.quest.com/support.
From our Support Portal, you can do the following:
l

Retrieve thousands of solutions from our online Knowledge Base

l

Download the latest releases and service packs

l

Create, update and review Support cases

View the Global Support Guide for a detailed explanation of support programs, online services,
contact information, policies and procedures. The guide is available at: www.quest.com/support.

Contact Quest Software
Email

[email protected]
Quest Software, Inc.
World Headquarters

Mail

5 Polaris Way
Aliso Viejo, CA 92656 
USA

Web site

www.quest.com

See our web site for regional and international office information.

About Quest Software
Quest Software simplifies and reduces the cost of managing IT for more than 100,000 customers
worldwide. Our innovative solutions make solving the toughest IT management problems easier,
enabling customers to save time and money across physical, virtual and cloud environments. For
more information about Quest go to www.quest.com.

Toad Data Modeler User Guide

1061

Getting Help

Established in 1987, Quest Software (Nasdaq: QSFT) provides simple and innovative IT
management solutions that enable more than 100,000 global customers to save time and money
across physical and virtual environments. Quest products solve complex IT challenges ranging
from database management, data protection, identity and access management, monitoring, user
workspace management to Windows management. For more information, visit www.quest.com.

Visit Modeling Community
Watch instructional flash movies that will guide you through great features of Toad Data
Modeler, learn about tips and tricks, read how-to's, tutorials, download sample scripts and user
packages, dictionary files and templates for reports, join our discussion forum and much more in
the Modeling Community at: http://modeling.inside.quest.com.

Submit Your Ideas and Suggestions
If already signed up as a modeling community member, you can register you ideas and
suggestions for new features and improvements in Toad Data Modeler in the Idea Pond at
http://toaddatamodeler.ideascale.com/. Vote for ideas you like to bubble them up and increase
the chances of having them implemented earlier.

ansi model

Index

reverse 262
A

access
specifics 747, 751
sql script 746-747
active template 480

application close dialog 48
application settings for subversion 493
application variables 374
examples 376
syntax 374

activeX 639

application view 33

add attribute 610, 640

application window 38

add entities 610, 640

apply naming convention rules 366

add image to workspace 81

arrange entity 100

aggregates 900

arrange objects in layers 336

AK attribute

assemblies 800

not null property 118
alias
toad for oracle aliases 652
align 67, 100
handle points 171

assign schema/owner/database 353
associations 630
create 630
edit 630
attribute 101, 105, 111-112, 114, 116,
122, 207, 297-298

objects 67
color 110
self relationship 100, 297
copy 112
align objects 335
create - ler model 297
alter reports 455
create - per model 101
alter script
create in PER Model 207
preserve data 450
data type 108
temporary tables 450
delete 116
alter script settings 464
edit - LER model 298
alter scripts 443
edit - PER model 105
alternate keys 117, 121, 224
move 114

Toad Data Modeler User Guide

1063

Index

order 111

check out 511

select 464

class 624

sort

color

nature order 396
unique 122

attributes 110
key attributes 110

attribute AK, PK

keys 116

not null property 118

color attributes and keys 350

attribute colors 464

color settings 464

attributes color 350

columns

auto complete 63

create 297

auto replacement words 482

edit 298

autolayout 333

com 639

autolayout settings 464

command line parameters 379

automatic synchronization of caption and
name 366

commit 500, 536

automation 639

insert 81
B

benefits 17, 84

compare models 455
compare procedures 190

benefits of logical model 289
body template 477

complete template 478
component inspector 564, 586, 590

C
call 639
caption of categories 83
cardinality 155, 167, 306
categories 83, 339, 381
character replacement 362
check constraint rules 197
check constraints 133, 227
check in 512

company logo

component palette 563, 586, 591
compound keys 128, 219
connection strings 514
conversion 302, 311, 313, 316
LER - PER 310, 316
PER - LER 286
PER - LER details 428
PER - PER details 425
simple model conversion 434

Toad Data Modeler User Guide

1064

Index

conversion settings 422
convert 286

db2 9.5
specifics 681

LER models 316

sql script 685

PER models 286

db2 9.7

convert model

specifics 686

select items 432

sql script 692

copy 68, 93, 112

db2 udb8

copy attributes 112

specifics 661

copy entities 93

sql script 667

copy attribute 610, 640

db2 v9

create 87, 101, 163, 211, 297, 307

specifics 668

attribute - LER model 297

sql script 678

attribute - PER model 101

db2 z/os v9

entity - PER model 87

databases 698

inheritance 307

specifics 699, 714

relationship 163, 211

sql script 712-713

create ERD 205
create script 577
create user template 479
customize forms 586
D
data types 140-141, 422
default data type 470
supported 140
data types conversion 422
database spaces 1005, 1021
databases 29, 658
supported 29, 658

ddl 741, 746-747, 774, 776, 798, 818,
821, 837, 842, 848-849, 861, 884,
891, 899, 914, 921, 929, 933, 940,
956, 961, 976, 990-991, 999, 1007,
1042, 1045
ddl script generation 266-267
referential integrity 269
select entities/workspaces 269
Verification 270
default data type 209
default data types 470
default template 480
default values 470, 565
referential integrity 470

Toad Data Modeler User Guide

1065

Index

defaults 195, 239

key - PER model 120

definer 842

relationship - PER model 164

delete 70, 116, 121

unique identifier 301

attribute 116

edit menu 49

key 121

edit source code 535

object 70

editable forms 586

delete template 481

edition 889

designer 39

encryption key 990, 998

dialog boxes 464-465

ending of lines 81

dictionaries 483

entities 294, 348

dictionary 147, 149, 154

delete 70

dictionary types 147, 154

display level 348

directories 850

edit - LER model 294

display attributes 110

right-click

display keys 116

LER model 296

display level 348

entity 87-88, 93, 96, 206

display modes 346

arrange in layer 100

dmx file 421

copy 93

dockable forms 42

create 87

docking 42

create