語法
db2gse.ST_NumPoints(l db2gse.ST_LineString)
回覆類型
Integer
範例
下列 CREATE TABLE 陳述式建立 NUMPOINTS_TEST 表格。 GEOTYPE 直欄包含儲存在 G1 幾何直欄的幾何類型。
CREATE TABLE NUMPOINTS_TEST (geotype varchar(12), g1 db2gse.ST_Geometry)
下列 INSERT 陳述式插入一個線串。
INSERT INTO NUMPOINTS_TEST VALUES( linestring, db2gse.ST_LineFromText('linestring (10.02 20.01, 23.73 21.92)', db2gse.coordref()..srid(0)))
下列 SELECT 陳述式和對應的結果集列示幾何類型和每一個幾何含有的點數目。
SELECT geotype, db2gse.ST_NumPoints(g1) FROM NUMPOINTS_TEST GEOTYPE Number of points ------------ ---------------- ST_linestring 2 1 record(s) selected.