ST_X takes a point and returns its X coordinate.
Syntax
ST_X(p ST_Point)
Return type
Double
Examples
The following CREATE TABLE statement creates the X_TEST table, which has two columns: the GID column, which uniquely identifies the row, and the PT1 point column.
CREATE TABLE X_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 X_TEST VALUES(1, db2gse.ST_PointFromText('point (10.02 20.01)', db2gse.coordref()..srid(0))) INSERT INTO X_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 X coordinate of the points.
SELECT gid, db2gse.ST_X(pt1) "The X coordinate" FROM X_TEST GID The X coordinate ----------- ------------------------ 1 +1.00200000000000E+001 2 +1.00200000000000E+001 2 record(s) selected.