IBM Books

Application Development Guide


Resolving Problems

If a stored procedure application fails to execute properly, ensure that:

Note:For more information on debugging Java stored procedures, see Debugging Stored Procedures.

You can use the debugger supplied with your compiler to debug a local FENCED stored procedure as you would any other application. Consult your compiler documentation for information on using the supplied debugger.

For example, to use the debugger supplied with Visual Studio(TM) on Windows NT, perform the following steps:

Step  1.

Set the DB2_STPROC_ALLOW_LOCAL_FENCED registry variable to true.

Step  2.

Compile the source file for the stored procedure DLL with the -Zi and -Od flags, and then link the DLL using the -DEBUG option.

Step  3.

Copy the resulting DLL to the instance_name \function directory of the server.

Step  4.

Invoke the client application on the server with the Visual Studio debugger. For the client application outcli.exe, enter the following command:

   msdev outcli.exe

Step  5.

When the Visual Studio debugger window opens, select Project -> Settings.

Step  6.

Click the Debug tab.

Step  7.

Click the Category arrow and select the Additional DLLs.

Step  8.

Click the New button to create a new module.

Step  9.

Click the Browse button to open the Browse window.

Step 10.

Select the module outsrv.dll and click OK to close the Settings window.

Step 11.

Open the source file for the stored procedure and set a breakpoint.

Step 12.

Click the Go button. The Visual Studio debugger stops when the stored procedure is invoked.

Step 13.

At this point, you can debug the stored procedure using the Visual Studio debugger.

Refer to the Visual Studio product documentation for further information on using the Visual Studio debugger.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]