ST_Endpoint takes a curve as an input parameter and returns the point that is the last point of the curve. The resulting point is represented in the spatial reference system of the given curve.
If the given curve is null or is empty, then null is returned.
This function can also be called as a method.
db2gse.ST_Point
SET CURRENT FUNCTION PATH = CURRENT FUNCTION PATH, db2gse
CREATE TABLE sample_lines(id INTEGER, line ST_Linestring)
INSERT INTO sample_lines VALUES
(1, ST_LineString('linestring (10 10, 5 5, 0 0, 10 0, 5 5, 0 10)', 0) )
INSERT INTO sample_lines VALUES
(2, ST_LineString('linestring z (0 0 4, 5 5 5, 10 10 6, 5 5 7)', 0) )
SELECT id, CAST(ST_AsText(ST_EndPoint(line)) as VARCHAR(50)) Endpoint
FROM sample_lines
ID ENDPOINT
----------- --------------------------------------------------
1 POINT ( 0.00000000 10.00000000)
2 POINT Z ( 5.00000000 5.00000000 7.00000000)