db2gse.ST_AsText utilise en entrée un objet de type géométrie et renvoie sa représentation textuelle connue (WKT - well-known text).
Syntaxe
db2gse.ST_AsText(g db2gse.ST_Geometry)
Type de retour
Varchar(4000)
Exemples
Dans le scénario présenté ci-après, la fonction db2gse.ST_AsText convertit le point de l'emplacement HAZARDOUS_SITES en la description textuelle correspondante :
CREATE TABLE HAZARDOUS_SITES (site_id integer, name varchar(40), location db2gse.ST_Point); INSERT INTO HAZARDOUS_SITES VALUES (102, 'W. H. Kleenare Chemical Repository', db2gse.ST_PointFromText('point (1020.12 324.02)', db2gse.coordref()..srid(0))); SELECT site_id, name, cast(db2gse.ST_AsText(location) as varchar(40)) "Location" FROM HAZARDOUS_SITES;
L'instruction SELECT renvoie l'ensemble de résultats suivant :
SITE_ID Name Location ------- ------------------------------------ ---------------------------------- 102 W. H. Kleenare Chemical Repository POINT (1020.00000000 324.00000000)