利用ST_GEOMETRY实现按辖区对点数据分类
按照空间查询所属上庄镇的gsmm数据。
declare
shp clob;
num number;
begin
select sde.st_asText(t.shape) into shp from hdyljspatial.hdjd_pg t where t.jdname='上庄镇';
select count(*) into num from hdyljspatial.gsmm g where sde.ST_Contains(sde.st_geomfromtext(shp,22),sde.st_geomfromtext(sde.st_asText(g.shape),22))=1;
dbms_output.put_line(num);
end;