ST_Y

The ST_Y function takes a point as an input parameter and returns its Y coordinate.

If the given point is null or is empty, then null is returned.

Syntax

Read syntax diagramSkip visual syntax diagramdb2gse.ST_Y(point)

Parameters

point
A value of type ST_Point for which the Y coordinate is returned or modified.

Return types

DOUBLE

Examples

Example 1

This example illustrates use of the ST_Y function. Geometries are created and inserted into the SAMPLE_POINTS table.

SET CURRENT PATH = CURRENT PATH, db2gse;
CREATE TABLE sample_points (id INTEGER, geometry ST_Point);

INSERT INTO sample_points (id, geometry)
  VALUES (1, ST_Point (2, 3, 32, 5, 1) );

INSERT INTO sample_points (id, geometry)
  VALUES (2, ST_Point (4, 5, 20, 4, 1) );

INSERT INTO sample_points (id, geometry)
  VALUES (3, ST_Point (3, 8, 23, 7, 1) );

Example 2

This example finds the Y coordinates of the points in the table.

SELECT id, ST_Y (geometry) Y_COORD
  FROM sample_points;
Results:

ID         Y_COORD
---------- ----------------------
         1 +3.00000000000000E+000
         2 +5.00000000000000E+000
         3 +8.00000000000000E+000