In many cases there is a need to create an object or to execute an SQL statement in multiple locations. The group execute option in TOAD for DB2 allows you to execute a script against multiple environments with one easy step. Let’s step through a few use cases.
Example 1: A new table needs to be added to multiple databases. The first step is to generate the necessary DDL and send it to the editor.

The next step is to go to the toolbar and select VIEW/GROUP EXECUTE:

The group execute window will open on the bottom of the editor, displaying all your cataloged connections. Select the locations you wish to execute the DDL from and click the execute button.

Status messages will be displayed next to selected targets and script executions can be view on the right.

Example 2: Execute a query against multiple databases and validate that the same results set is being brought back.
Open the Query in the editor and select the VIEW/GROUP EXECTUE option.

Select the desired targets and execute the query. Then right click on the results sets and send them to the Data Diff Viewer.
The Diff Viewer will then validate the results are the same.

As you can see the “Group Execute” option can be a very useful tool. It is very easy to replicate script executions across multiple environments and even multiple platforms of DB2 concurrently.