Oracle queryByAttributes

Hallgren Johan E jhhal at WMDATA.COM
Sat Nov 24 06:48:01 EST 2007


COOOL

It worked, many thanks

/Johan
___________________________________


Johan Hallgren

 
WM-data, Logica CMG
Pelle Bergs backe 3
Box 1938, 791 19 Falun
Tel (och mobil): 023-547 46 (int: +46-2354746)
johan.e.hallgren at wmdata.com
http://www.wmdata.se
-----Original Message-----
From: UMN MapServer Developers List [mailto:MAPSERVER-DEV at LISTS.UMN.EDU]
On Behalf Of Andreas Albarello
Sent: den 24 november 2007 11:39
To: MAPSERVER-DEV at LISTS.UMN.EDU
Subject: Re: [UMN_MAPSERVER-DEV] Oracle queryByAttributes

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