This tutorial will show you how to view the code that is contained in a stored procedure in DB2 using IBM Data Studio.
There are three options in IBM Data Studio called Activities from which you can view the code.
- Administer Databases
- Develop SQL and Routines
- Tune Queries
You choose Activity in the toolbar:
The three activity options are described below.
The Administer Databases activity
The Administer Databases activity option displays database objects using a data approach, so they are classified into two main groups: databases and sets.
To view the code of a stored procedure, perform any of the following options.
Option 1
- In the left pane of the screen that is displayed, expand the All Databases group and select the appropriate database to expand its objects tree, then select Application Objects, Stored Procedures.
- In the upper right pane, select the desired Stored Procedure.
- In the lower right pane, select the Source option to display the code.
Option 2
- In the upper right pane, click in the last icon of the pictorial path to display the list of options, then select Stored Procedures.
- Again, in the upper right pane, select the desired stored procedure and in the lower pane select the Source option to display the code.
The Develop SQL and Routines and the Tune Queries activity options
These activity options display database objects using a development approach, so they are classified into two main groups: Configuration Repositories and Database Connections.
Because both activities have the same options, they share the same steps described below.
To view the code of a stored procedure, perform any of the following options.
Option 1
- In the left pane of the screen that is displayed, select the Data Source Explorer tab and expand the Database Connections group.
- Select the appropriate database to expand its objects tree.
- Select Schemas, Stored Procedures and right click on the desired stored procedure.
- Choose the Properties option from the context menu.
- Finally, in the lower right pane select the Source option.