<HTML>
<HEAD>
<TITLE>Ticket #3042 - Problem with OGC Filter FEATUREID and WFS with type ORACLESPATIAL</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>This is Ticket #3042<BR>
<BR>
When querying an Oracle Spatial layer using WFS and passing a FEATUREID filter, the constructed sql query is missing parens around the collected OR predicates. It is missing 2 opening parens and the closing parens before the SDO_FILTER part and there is a quote character outside the last parens when it should be inside.<BR>
<BR>
This looks to be in mapogcfilter.c<BR>
<BR>
example call: <BR>
<BR>
<a href="http://localhost/cgi-bin/mapserv?map=cm2_dev/cm2_watwms.map&amp;SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=GetFeature&amp;FEATUREID=usgsgages.7759,usgsgages.7760,usgsgages.7761,usgsgages.7762,usgsgages.7792,usgsgages.7794,usgsgages.7795,usgsgages.7796,usgsgages.7797,usgsgages.7810,usgsgages.7811,usgsgages.7812&amp;TYPENAME=usgsgages">http://localhost/cgi-bin/mapserv?map=cm2_dev/cm2_watwms.map&amp;SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=GetFeature&amp;FEATUREID=usgsgages.7759,usgsgages.7760,usgsgages.7761,usgsgages.7762,usgsgages.7792,usgsgages.7794,usgsgages.7795,usgsgages.7796,usgsgages.7797,usgsgages.7810,usgsgages.7811,usgsgages.7812&amp;TYPENAME=usgsgages</a><BR>
<BR>
returns<BR>
<BR>
&lt;ServiceExceptionReport version=&quot;1.2.0&quot; xsi:schemaLocation=&quot;<a href="http://www.opengis.net/ogc">http://www.opengis.net/ogc</a> <a href="http://schemas.opengis.net/wfs/1.0.0/OGC-exception.xsd&quot;">http://schemas.opengis.net/wfs/1.0.0/OGC-exception.xsd&quot;</a>&gt;<BR>
&lt;ServiceException code=&quot;NoApplicableCode&quot; locator=&quot;mapserv&quot;&gt;<BR>
msWFSGetFeature: WFS server error. FLTApplyFilterToLayer() failed<BR>
msOracleSpatialLayerWhichShapes(): OracleSpatial error. Error: ORA-00933: SQL command not properly ended<BR>
<BR>
Query statement: SELECT objectid, PERCENTILE, SHAPE FROM METAR.USGS_REALSTX WHERE &nbsp;objectid = '7759') OR (objectid = '7760') OR (objectid = '7761') OR (objectid = '7762') OR (objectid = '7792') OR (objectid = '7794') OR (objectid = '7795') OR (objectid = '7796') OR (objectid = '7797') OR (objectid = '7810') OR (objectid = '7811') OR (objectid = '7812)' &nbsp;AND SDO_FILTER( SHAPE, MDSYS.SDO_GEOMETRY(2003, 8265, NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,3),MDSYS.SDO_ORDINATE_ARRAY(-177.47,13.43,-64.71,72.55) ),'querytype=window') = 'TRUE' . Check your data statement.<BR>
<BR>
&lt;/ServiceException&gt;<BR>
&lt;/ServiceExceptionReport&gt;<BR>
<BR>
<BR>
-- <BR>
Michael Smith<BR>
RSGIS Center<BR>
ERDC - CRREL<BR>
US Army Corps of Engineers<BR>
<BR>
<BR>
<BR>
</SPAN></FONT>
</BODY>
</HTML>