Exercise 1.1: Setting up the environment for stored procedure development

You must complete some setup steps before you can begin developing stored procedures in the workbench.

Enabling the database development capabilities

Before you can develop stored procedures in the workbench, you must enable the database development capabilities. Capabilities are groups of functions that can be hidden or revealed as you need them. When you start the workbench for the first time, the database development capabilities are hidden.

To enable the database development capabilites.

  1. From the menu bar, select Window > Preferences. The Preferences window opens.
  2. Expand the Workbench node, and click Capabilites.
  3. Expand the Database Developer node in the Capabilities list.
  4. Select Core Database Development and Stored Procedure and User-Defined Function Development.

    Note that there is also a capability for SQLJ development. You will not need this capability for the exercises in this tutorial, but if you were developing SQLJ stored procedures or applications you would also need to enable the SQLJ capability.

  5. Click OK to apply your changes and close the Preferences window.

Opening the Data perspective

Next, you will open the Data perspective, where you will perform all of the exercises in this tutorial.

You can use the Data perspective in the workbench to view, create, and edit database objects. You can connect to databases and browse database objects in the Database Explorer view, create and modify database objects in the Data Definition view, and modify database objects in the editors. You can also export data definitions to another database that is installed either locally or remotely.

To open the Data Perspective.

  1. From the menu bar, select Window > Open Perspective > Other. The Select Perspective window opens.
  2. Select the Show all check box.
  3. Click Data, then click OK.

The Data perspective opens in the foreground of the workbench window. If you have not created or imported any database resources before now, the views and editors are empty.

Creating a simple project for your stored procedures

Before you create database objects, you must create a project in which to store them. You could also add database objects to an existing project, but in this tutorial, you will create a new simple project to store the files that you are going to import and create.

  1. From the menu bar, select File > New > Project. The New Project wizard opens.
  2. In the New Project wizard, select Simple > Project, then click Next.
  3. In the Project name field, type SPSimple, then click Finish.

    The new project is displayed in the Data Definition view.

Now you are ready to begin Exercise 1.2: Creating a connection to the DB2 SAMPLE database and copying it to your project

Terms of use | Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.