ArcSDE query attribute

Johan Hallgren johan.e.hallgren at WMDATA.SE
Tue Feb 21 10:55:50 PST 2006


Hello

I have tried to query a sde-layer but it fails.

I’m using mapserver-4.8.1
And ArcSDE 9.0 clientlib (windows XP)
And ArcSDE 9.0 on a Oracle 10.1 (windows Server)
All code is written in c#/mapscript/SWIG.

Drawing the layer is no problem but when querying, it gives an error
message:
“Error allocating layer items array.”

The error occur when I run the oLayerObj.open() –command

Se the code below, I have used the same approach as with shapefiles.

-----------------------------------------
mapObj mo = new mapObj(mapFile.Text);
layerObj oLayerObj = mo.getLayerByName("SJ_large_sde");
oLayerObj.queryByRect(mo, oLayerObj.getExtent());

oLayerObj.queryByAttributes(mo, "KKOD", "", mapscript.MS_MULTIPLE);
resultCacheObj oResultCacheObj = oLayerObj.getResults();
oLayerObj.open(); // ß Gives the error.

textBox1.Text = oResultCacheObj.numresults.ToString();

if (oResultCacheObj.numresults > 0)
{
int iFeatureLimit = oResultCacheObj.numresults;
           int lFeat = 0;
           for (lFeat = 0; lFeat < oResultCacheObj.numresults; lFeat++)
           {
                      if (lFeat == (iFeatureLimit + 0))
                                 break;
                      shapeObj oShapeObj = oLayerObj.getFeature(lFeat,-1);
           }
}
---------------------------------

Best Regards
Johan
___________________________________

Johan Hallgren
WM-data
Pelle Bergs backe 3
Box 1938, 791 19 Falun
Tel: 023-844 65 (int: +46-2384465)
Mobil: 070-588 44 28 (int: +46-705884428)
johan.e.hallgren at wmdata.com
http://www.wmdata.se



More information about the MapServer-users mailing list