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

Travis Kirstine traviskirstine at gmail.com
Tue Feb 17 13:51:13 EST 2009


Sorry for the delay

This is the exact query string
DATA "geom from (select id as oid, geom from im_item where filename =
'DSM_UK.poly') as subquery using SRID=-1"

2009/2/12 thomas bonfort <thomas.bonfort at gmail.com>:
> I don't see why you're a problem with that query string. From my
> experience, there's a limitation  when you need to mix single and
> double quotes inside the sql expression.
>
> eg:
>
> DATA "way from (select way,osm_id ,leisure , landuse, name from
> osm_polygon where leisure='park' or leisure='golf_course' or
> landuse='recreation_ground' or landuse='cemetery') as foo using unique
> osm_id using srid=900913"
>
> works fine.
>
> Travis, could you post your exact data statement,  so we can check if
> your problem isn't elsewhere?
>
> regards,
> thomas
>
>
>
> On Thu, Feb 12, 2009 at 20:45, Travis Kirstine <traviskirstine at gmail.com> wrote:
>> 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
>>
>



-- 
Travis K.

Toronto, Canada
------------------------------------------------------------
"She knows there's no success like failure
And that failure's no success at all."
-Bob Dylan-
------------------------------------------------------------


More information about the mapserver-users mailing list