Oracle queryByAttributes

Andreas Albarello andreas.albarello at TERRITORIUMONLINE.COM
Sat Nov 24 05:38:32 EST 2007


On 24 Nov 2007, at 08:10, Hallgren Johan E wrote:

> Hello
>
> I have a problem with MapServer 5.0 and Oracle when using  
> queryByAttributes.
>
> Before I could use the following syntax;
> oLayerObj.queryByAttributes(m_MapObj, “OBJECTID”, “OBJECTID = 75”,  
> mapscript.MS_MULTIPLE);
>
> Now it does not work.
>
> The debug error is;
> <ERROR>mapscript_csharp<br/>msOracleSpatialLayerWhichShapes():  
> OracleSpatial error. Error: ORA-00933: SQL command not properly ended
>  . Query statement: SELECT OBJECTID, OBJECTID, shape FROM (SELECT  
> shape, NAMN, OBJECTID FROM SDO_KOMMUN) WHERE  OBJECTID =  OBJECTID =  
> 75  AND SDO_FILTER( shape, MDSYS.SDO_GEOMETRY(2003, NULL,  
> NULL 
> ,MDSYS 
> .SDO_ELEM_INFO_ARRAY 
> (1,1003,3 
> ),MDSYS 
> .SDO_ORDINATE_ARRAY 
> (1194973,6083188,1973312,7687503) ),'querytype=window') = 'TRUE' .  
> Check your data statement.</ERROR>
>
> Look at the where statement:
> WHERE  OBJECTID =  OBJECTID = 75

Johan,

try this instead:

oLayerObj.queryByAttributes(m_MapObj, NULL, “OBJECTID = 75”,  
mapscript.MS_MULTIPLE);

There's no need to pass in the item name as the second argument to  
queryByAttributes if you are querying anything but a shape file.

Best regards,

Andreas Albarello


More information about the mapserver-dev mailing list