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

Stephen Woodbridge woodbri at swoodbridge.com
Thu Feb 12 12:13:11 PST 2009


Anyone know if we have a bug open for this issue. It seems like a pretty 
simple oversight that could be fixed in 5.4 if someone would champion it.

-Steve

Bob Basques wrote:
> 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"
> 
> 




More information about the MapServer-users mailing list