User's Guide and Reference

Z

Z takes a point and returns its Z coordinate.

Syntax

Z(p db2gse.ST_Point)

Return type

Double

Examples

The following CREATE TABLE statement creates the Z_TEST table is created with two columns: the GID column uniquely identifies the row, and the PT1 point column.

CREATE TABLE Z_TEST (gid integer, pt1 db2gse.ST_Point) 

The following INSERT statements insert two rows. One is a point without a Z coordinate or a measure. The other column has both a Z coordinate and a measure.

INSERT INTO Z_TEST VALUES(1,
db2gse.ST_PointFromText('point (10.02 20.01)', db2gse.coordref()..srid(0)))
 
INSERT INTO Z_TEST VALUES(2,
db2gse.ST_PointFromText('point  zm (10.02 20.01 5.0 7.0)', db2gse.coordref()..srid(0))) 

The following SELECT statement and the corresponding result set lists the GID column and the Double Z coordinate of the points. The first row is NULL because the point does not have a Z coordinate.

SELECT gid, db2gse.Z(pt1) "The Z coordinate" FROM Z_TEST
 
GID         The Z coordinate
----------- ------------------------
          1                        -
          2   +5.00000000000000E+000
 
  2 record(s) selected. 


[ Top of Page | Previous Page | Next Page ]