<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-15">
<META content="MSHTML 6.00.2900.3243" name=GENERATOR></HEAD>
<BODY style="MARGIN: 4px 4px 1px">
<DIV>I don't have a problem with an internal quote in my map file using ms4w with Mapserver 5.2:</DIV>
<DIV>&nbsp;</DIV>
<DIV>FILTER "WHERE LEGAL_DESC LIKE '%%legal%%'"</DIV>
<DIV>&nbsp;</DIV>
<DIV>The double %% allow me to use wildcard searching.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Robert Sanson</DIV>
<DIV><BR>&nbsp; <BR>&gt;&gt;&gt; "Bob Basques" &lt;Bob.Basques@ci.stpaul.mn.us&gt; 13/02/2009 8:56 a.m. &gt;&gt;&gt;<BR>This was just talked about this past week in another thread.<BR><BR>I don't believe there is a method for escaping the internal quotes in the SQL statement you show.&nbsp; Possible option(s) would be to add a numeric column to the DB table/view for filtering on.&nbsp; Or make a call that returns more using a different SQL filter and use EXPRESSIONs in the Layer CLASS to filter further for display.&nbsp; This doesn't seem like the economical way to do things things though.<BR><BR>There was some stuff done in recent versions of MapServer though in EXPRESSIONs that may be related.<BR><BR>bobb<BR><BR><BR><BR><BR><BR>&gt;&gt;&gt; Travis Kirstine &lt;traviskirstine@gmail.com&gt; 02/12/09 1:45 PM &gt;&gt;&gt;<BR>The following line does not work and I think it has something to do<BR>with the single quotes.&nbsp; When I use double quotes Postgres thinks I'm<BR>referring to a column name.&nbsp; Is there a way to escape the single<BR>quotes?<BR>DATA "geom from (select id as oid, geom from some_table where<BR>some_field = 'some_string') as myquery using SRID=-1"<BR><BR>The following line works because I'm doing a numeric comparison.<BR>DATA "geom from (select id as oid, geom from some_table where<BR>some_field_number = 99) as myquery using SRID=-1"<BR><BR><BR>-- <BR>Travis K.<BR><BR>Toronto, Canada<BR>------------------------------------------------------------<BR>"She knows there's no success like failure<BR>And that failure's no success at all."<BR>-Bob Dylan-<BR>------------------------------------------------------------<BR>_______________________________________________<BR>mapserver-users mailing list<BR>mapserver-users@lists.osgeo.org<BR><A href="http://lists.osgeo.org/mailman/listinfo/mapserver">http://lists.osgeo.org/mailman/listinfo/mapserver</A>-users<BR><BR>_______________________________________________<BR>mapserver-users mailing list<BR>mapserver-users@lists.osgeo.org<BR><A href="http://lists.osgeo.org/mailman/listinfo/mapserver">http://lists.osgeo.org/mailman/listinfo/mapserver</A>-users<BR><BR></DIV><br><br><table bgcolor=white style="color:black"><tr><td><br>------------------------------------------------------------------<br>
The&nbsp;contents&nbsp;of&nbsp;this&nbsp;email&nbsp;are&nbsp;confidential&nbsp;to&nbsp;AsureQuality.&nbsp;If&nbsp;you&nbsp;have&nbsp;received&nbsp;this&nbsp;communication&nbsp;in&nbsp;error&nbsp;please&nbsp;notify&nbsp;the&nbsp;sender&nbsp;immediately&nbsp;and&nbsp;delete&nbsp;the&nbsp;message&nbsp;and&nbsp;any&nbsp;attachments.&nbsp;The&nbsp;opinions&nbsp;expressed&nbsp;in&nbsp;this&nbsp;email&nbsp;are&nbsp;not&nbsp;necessarily&nbsp;those&nbsp;of&nbsp;AsureQuality.&nbsp;This&nbsp;message&nbsp;has&nbsp;been&nbsp;scanned&nbsp;for&nbsp;known&nbsp;viruses&nbsp;before&nbsp;delivery.&nbsp;AsureQuality&nbsp;supports&nbsp;the&nbsp;Unsolicited&nbsp;Electronic&nbsp;Messages&nbsp;Act&nbsp;2007.&nbsp;If&nbsp;you&nbsp;do&nbsp;not&nbsp;wish&nbsp;to&nbsp;receive&nbsp;similar&nbsp;communications&nbsp;in&nbsp;future,&nbsp;please&nbsp;notify&nbsp;the&nbsp;sender&nbsp;of&nbsp;this&nbsp;message.<br>
------------------------------------------------------------------</td></tr></table><br><br>
<P align=center><FONT style="BACKGROUND-COLOR: #ffffff">This message has been scanned for malware by SurfControl plc.  </FONT><A href="http://www.surfcontrol.com/"><FONT style="BACKGROUND-COLOR: #ffffff" color=#000000>www.surfcontrol.com</FONT></A></P>
</body></HTML>