<br><font size=2 face="sans-serif">Hello List</font>
<br>
<br><font size=2 face="sans-serif">I'm using Mapserer with Oracle/Java-Mapscript
and migrating my app from Mapserver 4.x to Mapserer 5.x</font>
<br><font size=2 face="sans-serif">and have a problem with layerObj.queryByAttributes.</font>
<br>
<br><font size=2 face="sans-serif">I used to query features with code like
this:</font>
<br><font size=2 face="Courier New"> alayerObj.queryByAttributes(aMapObj,
"ID", "ID=4711", mapscript.</font><font size=2 color=#0021bf face="Courier New"><i>MS_SINGLE</i></font><font size=2 face="Courier New">);</font>
<br><font size=2 face="sans-serif">In Mapserver 5 this code results
in an Mapserver-Error-Message stating, that the "SQL command is not
properly ended".</font>
<br>
<br><font size=2 face="sans-serif">The Mapserver-generated SQL-Command
includes a Where-Clause of the form "ID = ID = 4711".</font>
<br>
<br><font size=2 face="sans-serif">I had a look in maporaclespatial.c function
"osFilteritem".</font>
<br><font size=2 face="sans-serif">Follwing code seems to produce this
Where-Clause:</font>
<br><font size=2 face="Courier New"> if (layer->filteritem != NULL)</font>
<br><font size=2 face="Courier New"> {</font>
<br><font size=2 face="Courier New"> sprintf (query_str + strlen(query_str),
" %s = ", layer->filteritem);</font>
<br><font size=2 face="Courier New"> //snprintf (query_str
+ strlen(query_str), " %s = ", layer->filteritem);</font>
<br><font size=2 face="Courier New"> }</font>
<br>
<br><font size=2 face="sans-serif">Changing my Java-Code to </font>
<br><font size=2 face="Courier New"> alayerObj.queryByAttributes(aMapObj,
"ID", "4711", mapscript.</font><font size=2 color=#0021bf face="Courier New"><i>MS_SINGLE</i></font><font size=2 face="Courier New">);</font>
<br><font size=2 face="sans-serif">solves the problem.</font>
<br>
<br><font size=2 face="sans-serif">Questions:</font>
<br><font size=2 face="sans-serif">* Is this a bug in Mapserver or a new
feature? </font>
<br><font size=2 face="sans-serif">* Is this really a change in Mapserver
5.0?</font>
<br><font size=2 face="sans-serif">* Shall I rather change my Java-Code
or shall I patch Mapserver/ maporaclespatial.c/osFilteritem?</font>
<br><font size=2 face="sans-serif"> Would the changed Java-Code
work with the Oracle-driver only?</font>
<br>
<br><font size=2 face="sans-serif">Greetings from Aachen/Germany</font>
<br><font size=2 face="sans-serif">Benedikt Rothe</font>
<br>
<br><font size=2 face="Courier New"><b>Attachement "Error-Message":
</b></font><font size=2 face="Arial">(Added Newlines) </font>
<br><font size=2 face="Arial">msOracleSpatialLayerWhichShapes(): OracleSpatial
error. Error: ORA-00933: SQL command not properly ended </font>
<br><font size=2 face="Arial"> . Query statement: </font>
<br><font size=2 face="Arial">SELECT </font>
<br><font size=2 face="Arial"> ID, ID, SHAPE</font>
<br><font size=2 face="Arial">FROM </font>
<br><font size=2 face="Arial"> (select ID,SHAPE </font>
<br><font size=2 face="Arial"> FROM MYTABLE) </font>
<br><font size=2 face="Arial"> WHERE </font><font size=2 color=red face="Arial"><b>ID
= ID = 4711</b></font><font size=2 face="Arial"> AND </font>
<br><font size=2 face="Arial"> SDO_FILTER( </font>
<br><font size=2 face="Arial"> SHAPE, MDSYS.SDO_GEOMETRY(2003,
82015,</font>
<br><font size=2 face="Arial"> NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,3),</font>
<br><font size=2 face="Arial"> MDSYS.SDO_ORDINATE_ARRAY(2501576.69,5621567,2503419.31,5622567)
),'querytype=window') = 'TRUE' . </font>
<br><font size=2 face="Arial">Check your data statement.</font>
<br>
<br><font size=2 face="Courier New"><b>Attachement "Part of mapfile":</b></font>
<br><font size=2 face="Courier New"> # Projekte</font>
<br><font size=2 face="Courier New"> LAYER</font>
<br><font size=2 face="Courier New"> NAME "PROJEKT"</font>
<br><font size=2 face="Courier New"> TYPE POINT</font>
<br><font size=2 face="Courier New"> STATUS DEFAULT</font>
<br><font size=2 face="Courier New"> #DEBUG ON</font>
<br><font size=2 face="Courier New"> TEMPLATE "dummy.html"</font>
<br><font size=2 face="Courier New"> CONNECTION "XXX/YYY@ZZZ"</font>
<br><font size=2 face="Courier New"> CONNECTIONTYPE oraclespatial</font>
<br><font size=2 face="Courier New"> DATA "SHAPE FROM
(select ID,SHAPE FROM MYTABLE) using unique ID srid 82015"</font>
<br><font size=2 face="Courier New"> CLASS</font>
<br><font size=2 face="Courier New"> NAME ""</font>
<br><font size=2 face="Courier New"> STYLE</font>
<br><font size=2 face="Courier New"> COLOR 0
100 100</font>
<br><font size=2 face="Courier New"> OUTLINECOLOR
0 0 0</font>
<br><font size=2 face="Courier New"> SIZE 12</font>
<br><font size=2 face="Courier New"> SYMBOL
'star'</font>
<br><font size=2 face="Courier New"> END</font>
<br><font size=2 face="Courier New"> END</font>
<br><font size=2 face="Courier New"> END</font>