Obtaining diagnostic information and debugging stored procedures
You have several options for obtaining diagnostic information and debugging stored procedures, depending on the type of stored procedure.
Procedure
To obtain diagnostic information and debug stored procedures:
Take the appropriate action, depending on the type of stored procedure that you use.
Type of stored procedure | Actions |
---|---|
All types of stored procedures |
|
C stored procedures | Use IBM Debug for z/OS. |
C++ stored procedures | Use IBM Debug for z/OS. |
COBOL stored procedures | Use IBM Debug for z/OS. |
External applications | Use a driver application. |
External SQL procedures | Use the Unified Debugger. Deprecated function: External SQL procedures are deprecated and not as fully supported as native SQL procedures. For best results, create native SQL procedures instead. For more information, see Creating native SQL procedures and Migrating an external SQL procedure to a native SQL procedure.
|
Java™ stored procedures | Use the Unified Debugger. |
Native SQL procedures | Use the GET DIAGNOSTICS statement. The DB2_LINE_NUMBER parameter returns:
|
What to do next
Remember: After you finish debugging stored procedures, remember to disable the
debugging option that you used, so that you do not run debugging tools in a production
system.