Spatial Extender stored procedure output parameters

Use the Spatial Extender stored procedure output parameters to diagnose problems when explicitly calling stored procedures.

The Spatial Extender stored procedures return the following output parameters for message information to indicate the success or failure of a stored procedure:
msg_code (message 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 Spatial Extender 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 (message text)
The msg_text parameter consists 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 through the SYSPROC.GET_MESSAGE procedure or the message reference for Spatial Extender.

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 Db2 Spatial Extender messages.

Working with stored procedures in applications

When you call a Db2 Spatial Extender stored procedure from an application, you will receive the msg_code and msg_text as output parameters. You can:
  • 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.