Generating SQL files

 

Procedure

We are now able to generate the DDL (Data Definition Language), in other words, the SQL code which describes the database diagram, from the generation work product that we have just created.
The Objecteering output window displays the generation steps and results.


Figure 14. Generating the SQL files for the "MPD_Library" package


Steps:

1.      Select the SQL generation work product in explorer using the right mouse-button.

2.      Run the "MDACs/SQL Designer/Generate SQL files" command from the context menu that appears.

 

Note:      Double-clicking on the generation work product runs the "Propagate" command for this same work product.


The O_SQL_USER environment variable can be positioned, in order to allow access to the database from Objecteering.


Example:

Setenv O_SQL_USER User_name/Password/Host_name

 

Note:      It is not necessary to position the O_SQL_USER environment variable in this way, as MDAC parameters exist for the user and his password, as well as parameter/attributes for the generation work product itself. However, this environment variable is necessary where a "Host_name" must be defined.

 

 

Visualizing the generated SQL

The SQL file is generated for the "MPD_Library" package and the classes that belong to it.


It is possible to visualize the generated SQL file from the Objecteering explorer. The "MDACs/SQL Designer/Visualize creation file" menu on the generation work product is used to open an editor on the generated file (as shown in Figure 15).

 


Figure 15. Visualizing the SQL creation file generated for the "MPD_Library" package

 

Note:      The  button in the "SQL" tab of the auxiliary window runs the same operation.