Was this helpful?
AsText
ASTEXT(Geometry[, len])
Alias: ST_ASTEXT
Returns Geometry in Well Known Text (WKT).
The optional len argument specifies an in-line length, in number of characters, for the long varchar result. Values outside the range of 0 to 32000 are adjusted to the minimum (0) or maximum (32000), accordingly.
Result type: string
Example:
SELECT ASTEXT(LINEFROMTEXT('LINESTRING(0 0, 2 2, 0 4, 6 6, 0 8, 10 10)'));
-------------------------------------------
col1
-------------------------------------------
LINESTRING (0 0, 2 2, 0 4, 6 6, 0 8, 10 10)
-------------------------------------------
Note:  The ASTEXT function returns a long varchar with the coordinates. Do not run the ASTEXT examples in the ISQL (the forms-based Terminal Monitor) application because it cannot display long data types and will return an "Unbounded data" error. Run the examples in SQL (the line-based Terminal Monitor).
Last modified date: 12/14/2023