Generate DDL for a Package


In the Corporate, Business and Software Engineering, System Engineering and Ultimate editions 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. The context menu displays.
  2. Select the Code Engineering | Generate DDL menu option. The Generate Package DDL dialog displays.


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.


  • Some checkboxes display only if the appropriate database is defined for the tables in the package. For example, IF EXISTS displays only if the database for the tables is PostgreSQL.
  • 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. Also set the AutoNum property to True in the column properties.
  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. Click on each table name to review information on that table.