> ## Documentation Index
> Fetch the complete documentation index at: /documents/llms.txt
> Use this file to discover all available pages before exploring further.

# ST_LineFromText,ST_LineStringFromText

> Converts a WKT (Well Known Text) to a memory representation in the form of Line.

Parses a `LINESTRING` from Well-Known Text (WKT).

## Syntax

```sql theme={null}
VARCHAR ST_LineFromText(VARCHAR wkt)
VARCHAR ST_LineStringFromText(VARCHAR wkt)
```

## Return value

Returns the legacy encoded shape as `VARCHAR`. Use [ST\_AsText](/documents/4.2/sql-reference/sql-functions/spatial-functions/st_astext.md) to display it as WKT.

## Examples

```Plain Text theme={null}
MySQL > SELECT ST_AsText(ST_LineFromText("LINESTRING (1 1, 2 2)"));
+---------------------------------------------------------+
| st_astext(st_linefromtext('LINESTRING (1 1, 2 2)'))     |
+---------------------------------------------------------+
| LINESTRING (1 1, 2 2)                                   |
+---------------------------------------------------------+
```

## keyword

ST\_LINEFROMTEXT,ST\_LINESTRINGFROMTEXT,ST,LINEFROMTEXT,LINESTRINGFROMTEXT

## Related data types

[VARCHAR](/documents/4.2/sql-reference/data-types/string-type/VARCHAR.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.