# ST\_PolyFromText

## Syntax

```sql
ST_PolyFromText(wkt[,srid])
ST_PolygonFromText(wkt[,srid])
PolyFromText(wkt[,srid])
PolygonFromText(wkt[,srid])
```

## Description

Constructs a [POLYGON](https://mariadb.com/docs/server/reference/sql-statements/geometry-constructors/geometry-constructors/polygon) value using its [WKT](https://mariadb.com/docs/server/reference/sql-statements/geometry-constructors/wkt/wkt-definition) representation and [SRID](https://mariadb.com/docs/server/reference/sql-statements/geometry-constructors/geometry-properties/st_srid).

`ST_PolyFromText()`, `ST_PolygonFromText()`, `PolyFromText()` and `ST_PolygonFromText()` are all synonyms.

## Examples

```sql
CREATE TABLE gis_polygon   (g POLYGON);
INSERT INTO gis_polygon VALUES
    (PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')),
    (PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))'));
```

<sub>*This page is licensed: GPLv2, originally from*</sub> [<sub>*fill\_help\_tables.sql*</sub>](https://github.com/MariaDB/server/blob/main/scripts/fill_help_tables.sql)

{% @marketo/form formId="4316" %}
