Db2 Spatial Extender function messages

Messages returned by Db2 Spatial Extender functions are typically embedded in an SQL message. The SQLCODE returned in the message indicates if an error occurred with the function or that a warning is associated with the function.

The following messages are examples that indicate an error and a warning:
  • The SQLCODE -443 (message number SQL0443) indicates that an error occurred with the function.
  • The SQLCODE +462 (message number SQL0462) indicates that a warning is associated with the function.

The following table explains the significant parts of this sample message:


DB21034E  The command was processed as an SQL statement because it was 
not a valid Command Line Processor command.  During SQL processing it 
returned: SQL0443N  Routine "DB2GSE.GSEGEOMFROMWKT" 
(specific name "GSEGEOMWKT1") has returned an error 
SQLSTATE with diagnostic text "GSE3421N  Polygon is not closed.".  
SQLSTATE=38SSL    

Table 1. The significant parts of Db2 Spatial Extender function messages
Message part Description
SQL0443N The SQLCODE indicates the type of problem.
GSE3421N The Db2 Spatial Extender message number and message type.

The message numbers for functions range from GSE3000 to GSE3999. Additionally, common messages can be returned when you work with Db2 Spatial Extender functions. The message numbers for common messages range from GSE0001 to GSE0999.

Polygon is not closed The Db2 Spatial Extender message explanation.
SQLSTATE=38SSL An SQLSTATE code that further identifies the error. An SQLSTATE code is returned for each statement or row.
  • The SQLSTATE codes for Spatial Extender function errors are 38Sxx, where each x is a character letter or number.
  • The SQLSTATE codes for Spatial Extender function warnings are 01HSx, where the x is a character letter or number.

An example of an SQL0443 error message

Suppose that you attempt to insert the values for a polygon into the table POLYGON_TABLE, as shown in the following statement:


INSERT INTO polygon_table ( geometry )
VALUES ( ST_Polygon ( 'polygon (( 0 0, 0 2, 2 2, 1 2)) ') )  
This results in an error message because you did not provide the end value to close the polygon. The error message returned is:

DB21034E  The command was processed as an SQL statement because it was 
not a valid Command Line Processor command.  During SQL processing it 
returned: SQL0443N  Routine "DB2GSE.GSEGEOMFROMWKT" 
(specific name "GSEGEOMWKT1") has returned an error 
SQLSTATE with diagnostic text "GSE3421N  Polygon is not closed.".  
SQLSTATE=38SSL    

The SQL message number SQL0443N indicates that an error occurred and the message includes the Spatial Extender message text GSE3421N Polygon is not closed.

When you receive this type of message, review the detailed explanation and recommended user response in the message reference for GSE3421N or in the long text message retrieved with the SYSPROC.GET_MESSAGE procedure.