ST_Z function
The ST_Z function takes a point as an input parameter and returns its Y coordinate. You can optionally indicate a Z coordinate as input parameter in addition to the point and the function returns the point itself with its Y coordinate set to the given value.
ST_Z takes either:
- A point as an input parameter and returns its Z coordinate
- A point and a Z coordinate and returns the point itself with its Z coordinate set to the given value, even if the specified point has no existing Z coordinate.
If the specified Z coordinate is null, then the Z coordinate is removed from the point.
If the specified point is null or empty, then null is returned.
This function can also be called as a method.
Syntax
Parameters
- point
- A value of type ST_Point for which the Z coordinate is returned or modified.
- z_coordinate
- A value of type DOUBLE that represents the new Z coordinate for point.
If z_coordinate is null, then the Z coordinate is removed from point.
Return types
- DOUBLE, if z_coordinate is not specified
- db2gse.ST_Point, if z_coordinate is specified