Topic
Prev Next

Execute DDL

The 'Execute DDL' tab provides a mechanism to easily execute generated DDL statements against a live database, and provides instant feedback on their success, all within the Enterprise Architect interface and without the need for other products.

There are two different types of DDL statement that Enterprise Architect can generate and send to the 'Execute DDL' tab:

  • Create DDL statements, created by the Generate DDL screen, and
  • Alter DDL statements, created by the Database Compare window

The Execute DDL functionality requires the Database Builder to have a valid ODBC connection to a live database. This database connection is shared between the SQL Scratch Pad, Database Compare and 'Execute DDL' tabs of the Database Builder.

Access

Open the Database Builder window, then display the 'Execute DDL' tab.

Access

Method

Ribbon

Design > Tools > Database Builder > Execute DDL

Execute the DDL

The 'Execute DDL' tab has these fields and buttons:

Field/Button

Action

1 Execution Queue

Lists the tasks (each with an associated DDL statement) that are yet to be executed. The list has three columns that specify the name of the object involved, the task and the action being performed.

Selecting an item in the list will display the associated DDL statement (in the 'Script' field) for the given task.

2 Script

A text box with SQL syntax highlighting, showing the DDL statement for the selected task.

3 Save

Click on this button to save all the individual DDL statements from both the 'Execution Queue' and the 'Results List' into a single file.

4 Reset Failed Actions

Click on this button to re-queue any failed or skipped tasks from the 'Results List' to the bottom of the 'Execution Queue'.

5 Skip

Click on this button to skip over the next task in the 'Execution Queue' and not execute it. The task will be moved into the 'Results List' and not given a result.

When you click on the Reset Failed Actions button, skipped tasks are returned to the Execution Queue along with any failed tasks.

6 Execute

Click on this button to execute the next task in the 'Execution Queue'. The task is removed from the top of the 'Execution Queue' and added to the end of the 'Results List' with the execution result.

7 Execute All

Click on this button to execute all tasks in the 'Execution Queue'. When execution is complete, the 'Results List' will display the results of each individual task.

8 Results List

Lists the executed tasks with the results of execution for each task. Selecting an item in this list will display the DDL statement that was executed, in the 'Script' field.

Example

In the example used in the earlier section regarding Database Comparison (when a column and constraint were renamed), if the defaults were used to 'push' the data model changes into the live database the Execute DDL screen would be populated with the details shown here.

In summary, DDL would be generated to drop both the old column and constraint (tasks 'Drop Constraint' and 'Drop Column'), then the column and constraint would be created with the new names (tasks 'Add Column' and 'Add Constraint') and finally each would have their comments/remarks applied (tasks 'Add Constraint - Constraint Comment' and 'Add Column - Column Comment').

Learn more