ST_PolyFromText utilise en entrée une représentation WKT du type polygone et un identificateur de système de références spatiales, et renvoie un polygone.
Syntaxe
db2gse.ST_PolyFromText(polygonTaggedText Varchar(4000), SRID db2gse.coordref)
Type de retour
db2gse.ST_Polygon
Exemples
L'instruction CREATE TABLE ci-après crée la table POLYGON_TEST qui comporte une seule colonne de type polygone.
CREATE TABLE POLYGON_TEST (pl1 db2gse.ST_Polygon)
L'instruction INSERT ci-après insère un polygone dans la colonne des polygones via la fonction ST_PolyFromText.
INSERT INTO POLYGON_TEST VALUES (db2gse.ST_PolyFromText( 'polygon((10.01 20.03,10.52 40.11,30.29 41.56, 31.78 10.74,10.01 20.03))', db2gse.coordref()..srid(0)))