You can use ERwin’s forward engineering feature to design and create your database without writing a single SQL CREATE TABLE or CREATE INDEX statement.
When you generate a schema, you can choose to generate:
|
|
|
V |
|
|
|
V |
|
|
|
V |
|
|
|
V |
|
|
Start up ErWin and open your agc.er1 file. Change your Layout to PHYSICAL using the selection list at the right of the button bar. Select the Tasks Menu the Forward Engineer / Schema Generation menu item ERWin lets you view and set schema generation options by category.
In the Schema Generation Editor, the left panel lists all the categories and the right panel lists all the options for the selected category. The target server you select determines which options appear in the Editor.
In the example below, the Drop Table option has been selected. This means the generated schema will include DROP TABLE statements for each table that you create.

We are not going to actually create the tables that the logical model describes. Instead we are going to create the report and save it to our local storage. This definition (if it includes the proper elements could then be transferred to the system where you wanted these tables and could be used to create the tables.
To create the Report click on the Preview button. Select the Save button and save this file as project5.sql to either your H drive or your A drive. At this point Close the Preview Window and Cancel out of the Schema Generation dialog box. Close your agc.er1 file without saving.
Next, start up Wordpad (not Notepad)
and open the file project5.sql Insert a blank
line at the top and type in your first and last name. Select Print
from the File menu and print just the first two pages. Save
the project5.sql file and Exit from Wordpad.
| NOTE: ErWin can take the text file created
by the schema generation process and use any utility to interpret SQL scripts
such as SPUFI for DB2, ISQL for SQL Server, SQL*DBA for ORACLE, or SQLTalk
for SQLBase.
Also, you determine what type of database tables you are going to generate by selecting the desired target server. |