ST_EqualCoordsys function

The ST_EqualCoordsys function takes two coordinate system definitions as input parameters and returns the integer value 1 (one) if the given definitions are identical. Otherwise, the integer value 0 (zero) is returned.

The coordinate system definitions are compared regardless of differences in spaces, parenthesis, uppercase and lowercase characters, and the representation of floating point numbers.

If any of the given coordinate system definitions is null, null is returned.

Syntax

Read syntax diagramSkip visual syntax diagramdb2gse.ST_EqualCoordsys(coordinate_system1, coordinate_system2)

Parameter

coordinate_system1
A value of type VARCHAR(2048) that defines the first coordinate system to be compared with coordinate_system2.
coordinate_system2
A value of type VARCHAR(2048) that defines the second coordinate system to be compared with coordinate_system1.

Return type

INTEGER

Example

This example compares two Australian coordinate systems to see if they are the same.

SET CURRENT FUNCTION PATH = CURRENT FUNCTION PATH, db2gse

VALUES ST_EqualCoordSys(
     (SELECT definition
      FROM   db2gse.ST_COORDINATE_SYSTEMS
      WHERE  coordsys_name='GCS_AUSTRALIAN') ,

     (SELECT definition
      FROM   db2gse.ST_COORDINATE_SYSTEMS
      WHERE  coordsys_name='GCS_AUSTRALIAN_1984')
      )

Results:

1
-----------
          0