Building DB2 routines

After you create or modify a routine (stored procedure or user-defined function), you can build it and register it on the DB2 database server. When you build a routine, the source code is compiled and the routine is registered with the database server. For SQL stored procedures that target DB2 Universal Database for Linux, UNIX, and Windows only, you can also choose to build the routine in debug mode, so that you can debug the routine later.

When you use a wizard to create a routine, you specify in the wizard whether to build the routine immediately after generating it. You can also build it later by following these steps.

To build a routine:

  1. Switch to the Data perspective.

  2. In the Data Definition view, right-click the routine that you want to build.

  3. In the pop-up menu, click Build, or click Build for Debug for SQL stored procedures only.

The build process begins, and you can view the progress and messages in the DB Output view. After the routine is built, you can refresh the Stored Procedures folder under the database connection in the Database Explorer view to verify that the routine was added to the server. The Data Definition view displays an icon of a wrench next to the routine name to indicate that the routine was built.

 

Related concepts

Developing DB2 user-defined functions
Overview of DB2 stored procedures tasks

 

Related tasks

Changing stored procedure build settings for DB2 Universal Database for z/OS
Changing run settings for DB2 routines
Running DB2 routines
Changing stored procedure build settings for DB2 Universal Database for z/OS

Related reference
Stored procedure and user-defined function support by DB2 Universal Database server type