在操作csw表時 發現很有用的xml查詢sql備忘如下:
select * from MDSYS.CSW_RT_6$ t where existsnode(t.datacol,'//*[geoglobe:parentId = "-1"]','xmlns:geoglobe="http://www.geostar.com.cn/geoglobe"') > 0 order by RECORDID;
select extractValue(t.datacol,'/geoglobe:ResourceType/geoglobe:name','xmlns:geoglobe="http://www.geostar.com.cn/geoglobe"') from MDSYS.CSW_RT_6$ t where t.recordid='330000000000010000';
select count(*) from MDSYS.CSW_RT_6$ t where t.datacol.existsnode('/geoglobe:ResourceType/geoglobe:chineseName','xmlns:geoglobe="http://www.geostar.com.cn/geoglobe"')=1;
select extractvalue(t.datacol,'/geoglobe:ResourceType/geoglobe:name','xmlns:geoglobe="http://www.geostar.com.cn/geoglobe"') from MDSYS.CSW_RT_6$ t where t.datacol.existsnode('/geoglobe:ResourceType/geoglobe:kind="CATALOG"','xmlns:geoglobe="http://www.geostar.com.cn/geoglobe"')=1;
select * from MDSYS.CSW_RT_6$ t where t.datacol.existsnode('/geoglobe:ResourceType[geoglobe:chineseName="永康市"]','xmlns:geoglobe="http://www.geostar.com.cn/geoglobe"')=1;
發現xml查詢功能很強悍!
轉載請註明出處! http://www.cnblogs.com/likehua/archive/2011/05/26/2057938.html