queryByAttributes with IN (arg)
Andreas Albarello
andreas.albarello at TERRITORIUMONLINE.COM
Fri Nov 24 09:02:22 EST 2006
Hallgren Johan E wrote:
> I tries to use MapServer and Oracle Spatial. Shouldn’t the following
> statement work?
>
> strWhere = ”KOPPLINGSID in (6246,4730,4123)”;
> strFld = “KOPPLINGSID”;
> oLayerObj.queryByAttributes(m_MapObj, strFld, strWhere,
> mapscript.MS_MULTIPLE);
>
> In the console I can read:
[...]
> msOracleSpatialLayerWhichShapes. Using this Sql to retrieve the data:
> SELECT row
>
> num, KOPPLINGSID, shape FROM (SELECT rownum, OBJECTID, GISSGUID,
> KOPPLINGSID, XM
>
> AX, YMAX, XMIN, YMIN, DATNY, DATEDIT, NAMNNY, NAMNEDIT, shape FROM
> FAT.GFAST ) W
>
> HERE KOPPLINGSID in
[...]
> The parenthesis with the argument is removed.
> Is the in statement not supported in mapserver?
Johan,
the "IN"-statement is indeed supported by Mapserver. What you are
experiencing is caused by the following bug:
http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=1948
Your choices are to either upgrade to the latest CVS snapshot or to try
the following workaround:
strWhere = "\"KOPPLINGSID in (6246,4730,4123)\"";
strFld = "KOPPLINGSID";
oLayerObj.queryByAttributes(m_MapObj, strFld, strWhere,
mapscript.MS_MULTIPLE);
Besides, you don't actually need to pass the field name (strFld) to
queryByAttributes when you are using SQL statements as expressions.
Passing an empty string or NULL instead should just work fine.
Best regards,
--
--------------------------------------------------------------------
Andreas Albarello
Analysis & SW Development
Territorium Online srl/GmbH
Via Buozzi/Buozzistraße 12 - I 39100 Bolzano/Bozen
email: andreas.albarello at territoriumonline.com
web: www.territoriumonline.com
--------------------------------------------------------------------
More information about the mapserver-dev
mailing list