[mapserver-users] How can I do a SQL text comparison in a mapfile?

Robert Sanson SansonR at asurequality.com
Thu Feb 12 15:10:18 EST 2009


I don't have a problem with an internal quote in my map file using ms4w with Mapserver 5.2:
 
FILTER "WHERE LEGAL_DESC LIKE '%%legal%%'"
 
The double %% allow me to use wildcard searching.
 
Robert Sanson

  
>>> "Bob Basques" <Bob.Basques at ci.stpaul.mn.us> 13/02/2009 8:56 a.m. >>>
This was just talked about this past week in another thread.

I don't believe there is a method for escaping the internal quotes in the SQL statement you show.  Possible option(s) would be to add a numeric column to the DB table/view for filtering on.  Or make a call that returns more using a different SQL filter and use EXPRESSIONs in the Layer CLASS to filter further for display.  This doesn't seem like the economical way to do things things though.

There was some stuff done in recent versions of MapServer though in EXPRESSIONs that may be related.

bobb





>>> Travis Kirstine <traviskirstine at gmail.com> 02/12/09 1:45 PM >>>
The following line does not work and I think it has something to do
with the single quotes.  When I use double quotes Postgres thinks I'm
referring to a column name.  Is there a way to escape the single
quotes?
DATA "geom from (select id as oid, geom from some_table where
some_field = 'some_string') as myquery using SRID=-1"

The following line works because I'm doing a numeric comparison.
DATA "geom from (select id as oid, geom from some_table where
some_field_number = 99) as myquery using SRID=-1"


-- 
Travis K.

Toronto, Canada
------------------------------------------------------------
"She knows there's no success like failure
And that failure's no success at all."
-Bob Dylan-
------------------------------------------------------------
_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org 
http://lists.osgeo.org/mailman/listinfo/mapserver-users 

_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org 
http://lists.osgeo.org/mailman/listinfo/mapserver-users 

------------------------------------------------------------------
The contents of this email are confidential to AsureQuality. If you have received this communication in error please notify the sender immediately and delete the message and any attachments. The opinions expressed in this email are not necessarily those of AsureQuality. This message has been scanned for known viruses before delivery. AsureQuality supports the Unsolicited Electronic Messages Act 2007. If you do not wish to receive similar communications in future, please notify the sender of this message.
------------------------------------------------------------------


This message has been scanned for malware by SurfControl plc. www.surfcontrol.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20090213/9289efa9/attachment-0001.html


More information about the mapserver-users mailing list