Output parameters for spatial support stored procedures
You can use stored procedure output parameters to diagnose problems when IBM® Spatial Support for Db2 for z/OS® stored procedures are invoked explicitly in application programs.
You can invoke IBM Spatial Support for Db2 for z/OS stored procedures explicitly in an application program or from a remote DB2 Connect client command line processor. To diagnose stored procedures that are invoked implicitly, use the messages that are returned by IBM Spatial Support for Db2 for z/OS.
- msg_code
- The msg_code parameter is an integer, which can be positive, negative,
or zero (0). Positive numbers are used for warnings, negative numbers
are used for errors (both critical and non-critical), and zero (0)
is used for informational messages. The absolute value of the msg_code is included in the msg_text as the message number. For example
- If the msg_code is 0, the message number is 0000.
- If the msg_code is –219 , the message number is 0219. The negative msg_code indicates that the message is a critical or non-critical error.
- If the msg_code is +1036, the message number is 1036. The positive msg_code number indicates that the message is a warning.
The msg_code numbers for IBM Spatial Support for Db2 for z/OS stored procedures are divided into the three categories shown in the following table:Table 1. Stored procedure message codes Codes Category 0000 – 0999 Common messages 1000 – 1999 Administrative messages 2000 – 2999 Import and export messages - msg_text
- The msg_text parameter is comprised of the message identifier,
the message number, the message type, and the explanation. An example
of a stored procedure msg_text value is:
GSE0219N An EXECUTE IMMEDIATE statement failed. SQLERROR = "<sql-error>".
The explanation that appears in the msg_text parameter is the brief explanation. You can retrieve additional information about the message that includes the detailed explanation and suggestions to avoid or correct the problem.
For a detailed explanation of the parts of the msg_text parameter, and information on how to retrieve additional information about the message, see How to interpret spatial support messages.
Working with stored procedures in applications
- Program your application to return the output parameter values to the application user.
- Perform some action based on the type of msg_code value returned.