Import from ER/Studio Data Architect
Features and Tools > Export/Import > Import from ER/Studio Data Architect
- Toad Data Modeler is able to import physical models for Oracle versions 9, 10, 11, and 12
- ER/Studio Data Architect 11 needs to be installed in order to import physical models into Toad Data Modeler
- Select File | Import | ER/Studio Data Architect to import models
DDL Script Generation
Script Generation Preparation
Features and Tools > DDL Script Generation > Script Generation Preparation
Before generating a DDL script, you might want to configure the following things:
Order of Generated Objects
Toad Data Modeler allows you to set the 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:
- Domains
- Entities
- Views
- Dictionary types
- Sequences
- Stored procedures
- Functions
- Users
- User data types
To set an order of objects for SQL/DDL script generation
- Go to Model Menu | Order of Generated Objects.
- Select an object, or an object type.
- Use to move your selection up/down by one step or use drag&drop to place your selection wherever you want.
|
Note: To display full names of objects, click on |
- Switch to Extension tab for more options. Press F2 or left-click and hold any of the values to set it as desired.
You can configure when should be the listed object types generated.
To sort objects automatically according to their relationships
- Select Model | Order of Generated Objects to set the desired order of entities
- Select Move Parent Entity before Child Entity - lists each parent entity before their respective child entities or
- Select Move Child Entity after Parent Entity - lists all child entities after their parent entities
|
Note: When you set After CREATE TABLE Section value for an object, the object will not be shown in Entity SQL Preview. |
Order of Generated Objects dialog is also accessible from DDL Script Generation dialog | Detail Settings tab| Edit.
Script Encoding
To set encoding for generated scripts
- Go to Settings Menu | Options | Model | Physical Model | SQL Generation Script tab | SQL Script section.
- Choose the preferred encoding from Encoding Used for SQL Scripts box.
How to Generate DDL Script
Features and Tools > DDL Script Generation > How to Generate DDL Script
This topic describes full configuration of a DDL script generation. In most cases, you will not need to configure all of the available settings.
|
Note: An Oracle 10g model is used in this topic. The dialogs and options available may vary depending on your model database platform and version. |
Start by opening DDL Script Generation dialog using any of these methods:
- Click the button on Model Toolbar
- Go to Model Menu | Generate DDL Script | Run
- Use shortcut - F9
Selecting Items for Generation
This essential part of script generation, you need to select items which should be generated.
Location of SQL File |
Select the location where the generated script will be saved. You can also select an already existing script and check Append to File checkbox to append the generated code to the original file. |
User/Schema |
Choose a user/schema from this box to only generate all of its assigned items. |
Selection |
You can save/load your custom selections. To do that, simply select the objects you want to be generated from the Objects Grid and then click button to save your selection. If you will generate scripts in the future, you can load your selection or even make it default . |
Bulk Selection |
This section contains several buttons that help you select multiple objects quickly. You can:
- Select All
- Deselect All
- Invert Selection
- Auto Check (if enabled, automatically checks sub-items when the parent item is checked)
There is also a combobox which can be used to assign Extended Value to all items in Objects Grid at once. |
Objects Grid |
In this grid you select objects you want to generate by checking them in the Property Name column. And in the Extended Value column you can choose the SQL statement which should be used for the specific item in the final script (e.g. create, replace, drop). |
Detailed Settings
Specific and database related settings can be found on this tab. Usually it is not necessary to change them in any way.
Referential Integrity
The main selection of objects for generation takes place in Select List. Referential integrity further specifies which relations are generated. It has the following options:
- Always - relationships are always generated if they are included in Select List
- If Child Table is Generated - relationship is generated only when its child table is included in Select List
- If Parent Table is Generated - relationship is generated only when its parent table is included in Select List
- If Child or Parent Table is Generated - relationship is generated only when child, parent or both are included in Select List
- If Child and Parent Tables are Generated - relationship is generated only when both child and parent tables are included in Select List
Select List
If you want to generate only a set of specific model objects, you can do exactly that on Select List tab. By default, all objects that have Generate checkbox checked (e.g. Entity Properties) will be generated (unless you edited some other setting). If you uncheck the Generate by Property "Generate", you are able to select any objects you want.
|
Note: This tab is linked to the What to Generate tab | Objects Grid. If you uncheck an object type there, it you won't be able to select any of its objects in Select List tab. |
Script Preview
You can preview the generated SQL script at any time. To do that, check the Show Preview checkbox on What to Generate tab. Then click the Generate button. Toad Data Modeler will offer you a preview of the script before you decide to save it. If you wouldn't have checked the Show Preview checkbox, the script would be saved first before you could preview it.
|
Note: Models are automatically verified before generating DDL script. To learn more, see Model Verification.
|
|
TIP: If you plan to do this action again in the future, you might want to click the Save Action button to save this Action Definition. See Model Actions for more information. |