<br><font size=2 face="sans-serif">Hi Fernando</font>
<br>
<br><font size=2 face="sans-serif">Thanks for your quick response!</font>
<br>
<br><font size=2 face="sans-serif">Since in many cases the where-part is
more complex the easiest &nbsp;solution for me</font>
<br><font size=2 face="sans-serif">is to omit the second parameter:</font>
<br><tt><font size=2>&nbsp; alayerObj.queryByAttributes(aMapObj, </font></tt><tt><font size=2 color=red><b>null</b></font></tt><tt><font size=2>,
&quot;ID=4711&quot;,mapscript./MS_SINGLE/);<br>
</font></tt>
<br><font size=2 face="sans-serif">Mmmh. It looks like this parameter was
useless all the time anyway!</font>
<br>
<br><font size=2 face="sans-serif">Thank you very much!</font>
<br><font size=2 face="sans-serif">Benedikt</font>
<br>
<br><font size=2 face="sans-serif">PS: The documentation in </font><tt><font size=2>http://mapserver.gis.umn.edu/docs/reference/mapfile/referencemanual-all-pages</font></tt>
<br><font size=2 face="sans-serif">states, that FILTERITEM is only used
in conjunction with OGR/Shapefile.</font>
<br>
<br>
<br><tt><font size=2>Fernando Simon &lt;fsimon@univali.br&gt; schrieb am
29.11.2007 16:57:40:<br>
<br>
&gt; Hi Benedikt,<br>
&gt; &nbsp; &nbsp; This is a Oracle Spatial driver change for 5.0. And
the source of<br>
&gt; this issue was relate with some Filter/FilterItem problems for Oracle<br>
&gt; Spatial in early versions (4.x).<br>
&gt; &nbsp; &nbsp; The osFilterItem function in the source code is relate
with FILTER<br>
&gt; and FILTERITEM definitions for Mapfile (you can see here:<br>
&gt; http://mapserver.gis.umn.edu/docs/reference/mapfile/referencemanual-all-pages)<br>
&gt; and Mapscript. In the PHPMapscript, the info for queryByAttribute
relate<br>
&gt; that the parameters that you pass will overwrite what you define for<br>
&gt; FILTER/FILTERITEM in Mapfile. In the same doc for queryByAttribute:<br>
&gt; &quot;qitem is the item (attribute) on which the query is performed,
and<br>
&gt; qstring is the expression to match.&quot;<br>
&gt; &nbsp; &nbsp; &nbsp;In the source code for 5.0 version this is a new
(maybe better)<br>
&gt; interpretation for the docs. I believe that this new way is better
when<br>
&gt; compared with the docs.<br>
&gt; &nbsp; &nbsp; &nbsp;Best regards.<br>
&gt; <br>
&gt; Fernando Simon<br>
&gt; <br>
&gt; <br>
&gt; Benedikt Rothe wrote:<br>
&gt; &gt;<br>
&gt; &gt; Hello List<br>
&gt; &gt;<br>
&gt; &gt; I'm using Mapserer with Oracle/Java-Mapscript and migrating my
app<br>
&gt; &gt; from Mapserver 4.x to Mapserer 5.x<br>
&gt; &gt; and have a problem with layerObj.queryByAttributes.<br>
&gt; &gt;<br>
&gt; &gt; I used to query features with code like this:<br>
&gt; &gt; &nbsp; alayerObj.queryByAttributes(aMapObj, &quot;ID&quot;, &quot;ID=4711&quot;,<br>
&gt; &gt; mapscript./MS_SINGLE/);<br>
&gt; &gt; In Mapserver 5 this code &nbsp;results in an Mapserver-Error-Message<br>
&gt; &gt; stating, that the &quot;SQL command is not properly ended&quot;.<br>
&gt; &gt;<br>
&gt; &gt; The Mapserver-generated SQL-Command includes a Where-Clause of
the<br>
&gt; &gt; form &quot;ID = ID = 4711&quot;.<br>
&gt; &gt;<br>
&gt; &gt; I had a look in maporaclespatial.c function &quot;osFilteritem&quot;.<br>
&gt; &gt; Follwing code seems to produce this Where-Clause:<br>
&gt; &gt; &nbsp;if (layer-&gt;filteritem != NULL)<br>
&gt; &gt; &nbsp;{<br>
&gt; &gt; &nbsp; &nbsp;sprintf (query_str + strlen(query_str), &quot; %s
= &quot;, layer-&gt;filteritem);<br>
&gt; &gt; &nbsp; &nbsp;//snprintf (query_str + strlen(query_str), &quot;
%s = &quot;,<br>
&gt; &gt; layer-&gt;filteritem);<br>
&gt; &gt; &nbsp;}<br>
&gt; &gt;<br>
&gt; &gt; Changing my Java-Code to<br>
&gt; &gt; &nbsp; alayerObj.queryByAttributes(aMapObj, &quot;ID&quot;, &quot;4711&quot;,<br>
&gt; &gt; mapscript./MS_SINGLE/);<br>
&gt; &gt; solves the problem.<br>
&gt; &gt;<br>
&gt; &gt; Questions:<br>
&gt; &gt; * Is this a bug in Mapserver or a new feature? &nbsp;<br>
&gt; &gt; * Is this really a change in Mapserver 5.0?<br>
&gt; &gt; * Shall I rather change my Java-Code or shall I patch Mapserver/<br>
&gt; &gt; maporaclespatial.c/osFilteritem?<br>
&gt; &gt; &nbsp; &nbsp;Would the changed Java-Code work with the Oracle-driver
only?<br>
&gt; &gt;<br>
&gt; &gt; Greetings from Aachen/Germany<br>
&gt; &gt; Benedikt Rothe<br>
&gt; &gt;<br>
&gt; &gt; *Attachement &quot;Error-Message&quot;: *(Added Newlines)<br>
&gt; &gt; msOracleSpatialLayerWhichShapes(): OracleSpatial error. Error:<br>
&gt; &gt; ORA-00933: SQL command not properly ended<br>
&gt; &gt; &nbsp;. Query statement:<br>
&gt; &gt; SELECT<br>
&gt; &gt; &nbsp; ID, ID, SHAPE<br>
&gt; &gt; FROM<br>
&gt; &gt; &nbsp; (select ID,SHAPE<br>
&gt; &gt; &nbsp; &nbsp;FROM MYTABLE)<br>
&gt; &gt; &nbsp; &nbsp;WHERE &nbsp;*ID = &nbsp;ID = 4711* &nbsp;AND<br>
&gt; &gt; &nbsp; &nbsp;SDO_FILTER(<br>
&gt; &gt; &nbsp; &nbsp; &nbsp;SHAPE, MDSYS.SDO_GEOMETRY(2003, 82015,<br>
&gt; &gt; &nbsp; &nbsp; &nbsp;NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,3),<br>
&gt; &gt; &nbsp; &nbsp; &nbsp;MDSYS.SDO_ORDINATE_ARRAY(2501576.69,5621567,2503419.31,5622567)<br>
&gt; &gt; ),'querytype=window') = 'TRUE' .<br>
&gt; &gt; Check your data statement.<br>
&gt; &gt;<br>
&gt; &gt; *Attachement &quot;Part of mapfile&quot;:*<br>
&gt; &gt; &nbsp; # Projekte<br>
&gt; &gt; &nbsp; LAYER<br>
&gt; &gt; &nbsp; &nbsp; NAME &quot;PROJEKT&quot;<br>
&gt; &gt; &nbsp; &nbsp; TYPE POINT<br>
&gt; &gt; &nbsp; &nbsp; STATUS DEFAULT<br>
&gt; &gt; &nbsp; &nbsp; #DEBUG ON<br>
&gt; &gt; &nbsp; &nbsp; TEMPLATE &quot;dummy.html&quot;<br>
&gt; &gt; &nbsp; &nbsp; CONNECTION &quot;XXX/YYY@ZZZ&quot;<br>
&gt; &gt; &nbsp; &nbsp; CONNECTIONTYPE oraclespatial<br>
&gt; &gt; &nbsp; &nbsp; DATA &quot;SHAPE FROM (select ID,SHAPE FROM MYTABLE)
using unique ID<br>
&gt; &gt; srid 82015&quot;<br>
&gt; &gt; &nbsp; &nbsp; CLASS<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; NAME &quot;&quot;<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; STYLE<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; COLOR 0 100 100<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; OUTLINECOLOR 0 0 0<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; SIZE 12<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; SYMBOL 'star'<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; END<br>
&gt; &gt; &nbsp; &nbsp; END<br>
&gt; &gt; &nbsp; END <br>
</font></tt>