Chat now with support
Chat with Support

Toad Data Modeler 6.3 - User Guide

Introduction User Interface Models and Model Objects
Physical Data Model
About Physical Data Modeling Benefits of Physical Data Model Entity Relationship Diagram Objects Basic Database Design Advanced Database Design
Universal Data Model Logical Data Model Working with Model Objects Model Properties Model Statistics
Features and Tools
Application Variables Export/Import DDL Script Generation Graphics Model Actions Print Projects Reports Reverse Engineering Scripting and Customization SQL Templates Tips and Tricks Toad for Oracle Integration Toad Intelligence Central (TIC) Integration Tools Version Control
Options and Configuration Databases
Supported Databases Connection Types by Database DB2 UDB v. 8 (LUW) DB2 v. 9 (LUW) DB2 v. 9.5 (LUW) DB2 v. 9.7 (LUW) DB2 v. 10.1 (LUW) DB2 v. 10.5 (LUW) DB2 z/OS v. 9 DB2 z/OS v.10 DB2 z/OS v. 11 Greenplum 4.1 Greenplum 4.2 Ingres 9.3 Ingres 10.0 Microsoft Access 2000/2002/2003 Microsoft Access 2007/2010 Microsoft Azure SQL Database Microsoft Azure SQL Database V12 Microsoft SQL Server 2000 Microsoft SQL Server 2005 Microsoft SQL Server 2008 Microsoft SQL Server 2012 Microsoft SQL Server 2014 Microsoft SQL Server 2016 MySQL 5.0 MySQL 5.1 MySQL 5.5 MySQL 5.6 MySQL 5.7 Oracle 9i Oracle 10g Oracle 11g Release 1 Oracle 11g Release 2 Oracle 12c Release 1 Oracle 12c Release 2 PostgreSQL 8.1 PostgreSQL 8.2 PostgreSQL 8.3 PostgreSQL 8.4 PostgreSQL 9.0 PostgreSQL 9.1 PostgreSQL 9.2 PostgreSQL 9.3 PostgreSQL 9.4 PostgreSQL 9.5 SQLite 3.7 Sybase ASE 12.5 Sybase ASE 15 Sybase ASE 15.5 Sybase ASE 15.7 SAP ASE 16.0 Sybase IQ 15.2 Sybase SQL Anywhere 11 SAP SQL Anywhere 17 Teradata 13 Vertica Database 8.0
Legal Information

Macros and User Forms

Features and Tools > Scripting and Customization > Macros > 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 specific 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 appropriate 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:

  • 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.
  • 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:


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;

  • ControlName – Name under which the control is accessible.
  • ControlType – Number of control type that should be created.

See the following table:

- 1 - Edit Box
- 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.


This function displays the form.

Procedures of Form

AddUserVariable(AName: widestring, DefaultValue)

  • AName – Name under which a variable is accessible in events of forms.
  • 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)

  • AName – Name of object via which it will be accessible in events.
  • Aobject – Object that is registered.

Use this procedure to register objects in events.

Properties of Form

Caption – Heading of the form.

CloseAfterExecuteTrue – When you click Execute, the code will be executed and the form closes. False – The form will not close after execution. Default: False.

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.


To assign events, assign the component of particular event to properties of names NameEventScriptName, NameEventMethodName with reference to particular service method.


Button.OnClickScriptName = ‘MyScript’;

Button.OnClickMethodName = ‘DoOnClick’;


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.

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.



OnClick – Occurs when you click the button.



OnClick – Occurs when the check in checkbox is changed.



OnSelect - Occurs when combo box is selected.



OnChangeText – Occurs when text in edit box is changed.



OnChangeText – Occurs when text in memo is changed.

Radio Button


OnClick – Occurs when the button is selected.

For more properties, please read the Reference Guide (Expert Mode main menu, Expert Mode has to be enabled.). See objects: UserButton, IUserCheckBox, IUserComboBox, UserControl, UserEdit, UserFormBasic, UserForm, UserGroupBox, IUserLabel, UserListBox, UserMemo, IUserPanel, UserRadioButton, UserStrings.

Macro and User Forms - Use Case

Features and Tools > Scripting and Customization > Macros > Macro and User Forms - Use Case


You want to create a macro that will add a 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.

  1. On tab Visibility, select where you want to apply the macro – Physical Model.
  2. On tab Menu, define whether you want to display the macro in:
  • Macro menu,
  • pop-up menu,
  • 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.

  1. On tab Object Types, select in which object pop-up menu you want to display it. Select Workspace.
    Confirm OK.

  1. Double-click the macro in Script Explorer to open Script Editor. Modify the default code.

  1. Click Commit and Save.
  2. Right-click the Workspace |Macros |Add Prefix to open the user form.


About Metamodel

Features and Tools > Scripting and Customization > Metamodel > About Metamodel

Toad Data Modeler implements the concept of metamodels. Metamodels are accessible only in Expert Mode (via Package Explorer).

Metamodel is a graphical representation of objects, classes, methods and relationships between them in a specific Package.

Using metamodels, you can create your own classes, methods and properties and define relationships between those items and items that are created in the application by default.

Important: It is recommended to only use lower and uppercase letters for naming your objects in metamodels (no numbers and special characters).


Example: The metamodel of Oracle package


Open Metamodels

  1. Open (or select Expert Mode Menu | Customization | Package Explorer).
  2. Select a package.
  3. Right-click the package and select Open Metamodel.


Related Documents

The document was helpful.

Select Rating

I easily found the information I needed.

Select Rating