These two functions are similar; they both involve using the PlayPen (usually) and generating SQL. The Forward Engineer function always creates a SQL script to generate a database identical with the complete current project (current PlayPen contents). The Compare DM function can output either an English-language description or a SQL script describing the differences between two databases, or stored projects, or one of these and the PlayPen.
Forward Engineering creates a SQL Script that can be run to update or put the components of the current Playpen into a database
First set the target connection to the database
you want the changes to be made in. Then go to
"Tools" and click "Forward Engineering". Another
way is to press the "Forward Engineering" button
at the top. This pops up a dialog that looks
similar to the one below:
Fill in the fields as necessary and hit "OK" when you are done. Depending on the situation, a dialog warning you of possible side-effects of creating the script may pop up. Finally a script that would create data structure currently in the Playpen will be displayed. It is the same dialog used in CompareDataModel-Part 2- In SQL Script.
The Compare DataModel Function takes two databases or Power*Architect projects (or one of each) or the current PlayPen, and compares and contrasts the structure of the two database/projects.
To start the Compare Data Model Function,
either go to "Tools" and click "Compare Data
Model" or just click the "Compare Data
Model" icon on the project toolbar. This
will bring up the main Compare Data Model
window. Here select the source and target
models you want to compare and contrast. You
can choose either the current playpen, an
existing database or select a saved project
file function. If one of or both the source
and the target has invalid models, the start
button will not enable. The similarities and
differences can be displayed either in SQL
Script language or in English.
If this option is selected, a side-by-side document will be displayed stating the similarlities and differences of the source and target in plain English. The left text gives English descriptions to make the source database look like the target database. In addition to the text, they are also colour coded. You can copy the text to the clipboard by pressing the copy button, or save the results to a text file. The table below explains what each colour means.
Table 3.2. Compare Database Model Colour Codes
If this option is chosen, this will produce a SQL Script in the SQL dialect chosen in Step 1 to make the source database look like the target database. You can either copy the results to the clipboard, or save the results in a text file. If the source has a valid connection database, the Execute button will enable and you can directly execute the changes. If the source does not have a valid connection, the execute button is disabled.