This tutorial teaches you how to create,
test, and deploy a DB2® SQL stored
procedure, which can improve application performance by reducing database
access traffic. For each SQL statement, a database manager application
must initiate a separate communication with DB2. Database performance is improved because
the stored procedure runs the SQL statement on the server rather than
on the client. In addition, DB2 stored
procedures also help to centralize business logic by immediately making
changes to a stored procedure available to all client applications.
A SQL stored procedure is a stored procedure where the source
code is part of the CREATE PROCEDURE statement, or the stored procedure
body.
Learning objectives
Upon
successful completion of these exercises, you should be able to:
- Set up the workbench environment for stored procedure development
- Connect to the DB2 SAMPLE
database and create a data development project to work with the database
- Create an SQL stored procedure
- Deploy, debug, and run the stored procedure from the workbench
- Export and deploy the stored procedure from the file system
This tutorial should take approximately 60 minutes to
finish. If you explore other concepts related to this tutorial, it
could take longer to complete.
Skill level
Advanced
Audience
Database developers
System requirements
- You must install and configure the SAMPLE database that is included
with DB2 for Linux, UNIX,
and Windows. See the DB2 documentation and First Steps
for more information
- If you want to follow the steps in this tutorial for debugging
a stored procedure, you must have DB2 for Linux, UNIX, and Windows Version
9.1 or higher.
Prerequisites
In order to complete this
tutorial, you should be familiar with the following concepts:
- Database development
- SQL and SQL stored procedure development