Spatial function messages
Spatial function messages 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.
- SQLCODE -443 (message number SQL0443) indicates that an error occurred with the function.
- 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:
SQL0443N Routine "GEOGEOFROMTEXT" (specific name "GEOGEOFROMTEXT0") has
returned an error SQLSTATE with diagnostic text "GSE3421N Polygon is not
closed.". SQLSTATE=38SSL
| Message part | Description |
|---|---|
| SQL0443N | The SQLCODE indicates the type of problem. |
| GSE3421N | The spatial 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 spatial functions. The message numbers for common messages range from GSE0001 to GSE0999. |
| Polygon is not closed | The spatial message explanation. |
| SQLSTATE=38SSL | An SQLSTATE code that further identifies
the error. An SQLSTATE code is returned for each statement or row.
|
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)) ') )
SQL0443N Routine "GEOGEOFROMTEXT" (specific name "GEOGEOFROMTEXT0") 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 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.