Generate DDL for a Package

Return to Introduction  Previous page  Next page

Note:

In the Corporate edition of Enterprise Architect, if security is enabled you must have Generate Source Code and DDL permission to generate DDL.

In this procedure, you can generate DDL for a package, and also compare the DDL with the database.

Generate DDL

To generate DDL for a package, follow the steps below:

  1. Right-click on the required package in the Project Browser window. The context menu displays.
  2. Select the Code Engineering | Generate DDL menu option. The Generate Package DDL dialog displays.
     
    GenerateDDLPackage
     

Note:

Alternatively you can select the Project | Database Engineering | Generate Package DDL menu option.

  1. Select the checkbox against each inclusion required. Deselect the checkboxes for inclusions you do not require.

Note:

If generating Oracle sequences, you must always select the Generate Triggers and Generate Sequences checkboxes; this ensures that a pre-insert trigger is generated to select the next sequence value to populate the column.

  1. To recursively generate DDL, select the Include All Child Packages checkbox.
  2. Click on the Generate button to proceed. Enterprise Architect prompts you for file names as the process executes.

Compare DDL For a Database

When you have generated the DDL, you can compare it with the database. To do this, follow the steps below:

  1. On the Generate Package DDL dialog, click on the Compare button. The Compare With Database dialog displays.
     
    Compare With Database
     
  2. Click on the [ ... ] button and locate the required database on the Select Data Source dialog.
  3. For an Oracle database, if required you can also specify the Owner in the Schema/Owner field.
  4. Click on the View button to perform the comparison. The Comparison Database dialog displays with the results of the comparison.
     
    CompareDDL