Functions
Toad Data Modeler allows you to design Entity Relationship Diagrams of specific database platforms, convert physical model from one database platform to another, create an ER Diagram directly from your database (Reverse Engineering feature), update physical models, generate DDL/SQL scripts and Change Scripts, create Dictionary Types, Views, Triggers, Functions, generate detailed documentation to your model (in HTML, RTF, PDF, XSLT formats) and much more.
This chapter describes features and functions related 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 of Toad Data Modeler. Default location is: C:\Program Files (x86)\Quest Software\Toad Data Modeler7.3\Samples. |
Benefits of Physical Data Model
- Detailed definition of database structure, including database specific items, for example:
- Stored procedures
- Functions
- Triggers
- Views
- Materialized views
- Sequences (auto increments) etc.
- Possibility to synchronize local model with existing database.
- Possibility to specify logical names for objects (captions for tables, attributes and other objects).
- Detailed database specific information can be exported to HTML/RTF/PDF or XML/XHTML/CSV reports.
- Automatic generation of SQL code for selected objects (SQL code generation is not available in Logical and Universal Model)
- Automatic migration of PK attributes to child entities (Attributes don't migrate to child entities in Logical Model)
Functions
To add a function
Right-click the Functions item in Model Explorer | Add Function.
To edit a function
Double-click the selected function in Model Explorer | Functions (or right-click Edit).
Example: The Function Properties dialog (Oracle 10g)
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 Return Value |
Define data type of the 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.)
About Templates |
To Do Tab |
On this tab, you can write some tasks on the selected function. |
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)
Defaults
Toad Data Modeler allows you to design Entity Relationship Diagrams of specific database platforms, convert physical model from one database platform to another, create an ER Diagram directly from your database (Reverse Engineering feature), update physical models, generate DDL/SQL scripts and Change Scripts, create Dictionary Types, Views, Triggers, Functions, generate detailed documentation to your model (in HTML, RTF, PDF, XSLT formats) and much more.
This chapter describes features and functions related 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 of Toad Data Modeler. Default location is: C:\Program Files (x86)\Quest Software\Toad Data Modeler7.3\Samples. |
Benefits of Physical Data Model
- Detailed definition of database structure, including database specific items, for example:
- Stored procedures
- Functions
- Triggers
- Views
- Materialized views
- Sequences (auto increments) etc.
- Possibility to synchronize local model with existing database.
- Possibility to specify logical names for objects (captions for tables, attributes and other objects).
- Detailed database specific information can be exported to HTML/RTF/PDF or XML/XHTML/CSV reports.
- Automatic generation of SQL code for selected objects (SQL code generation is not available in Logical and Universal Model)
- Automatic migration of PK attributes to child entities (Attributes don't migrate to child entities in Logical Model)
Defaults
To add a default
Select Model | Model Items |Defaults and click Add in the Defaults dialog.
To edit a default
Select Model | Model Items | Defaults and double-click the selected default or click Edit.
|
Note: 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
- Open the Attribute Properties dialog of the selected attribute | General tab.
- From the Default Rule box, select a default or write your own default to the Default box.
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. |