[mapserver-users] A problem with the Run-time substitution

Janne Tuovinen janne.tuovinen at menturagroup.com
Tue Nov 8 02:23:53 PST 2016


Hi,

Ok this is a bit complicated but i try to explain. My problem was that I
was using the basic openlayers template (...&template=openlayers). My
parameter (...&param=1000) was passed correctly to the Mapserver but not
to the openlayers template. The template then used query without the
parameter and the MapServer always used my default value for a database
query.

Thanks,
Janne   

  


11/7/2016, 4:32 PM, Rahkonen Jukka (MML) kirjoitti:
> Hi,
>
> Your SQL was missing the parenthesis, which I suppose to be mandatory with IN
> http://www.1keydata.com/sql/sqlin.html
>
> -Jukka Rahkonen-
>
>
> -----Alkuperäinen viesti-----
> Lähettäjä: mapserver-users [mailto:mapserver-users-bounces at lists.osgeo.org] Puolesta Burgholzer, Robert (DEQ)
> Lähetetty: 7. marraskuuta 2016 16:18
> Vastaanottaja: mapserver-users at lists.osgeo.org
> Aihe: Re: [mapserver-users] A problem with the Run-time substitution
>
> By includiong the single quotes in the PROCESING directive, doesn't that make your input evaluated as a string?  You example suggests that mapserver considers single quotes around the input to be bad and rejects it - but by putting single quotes in PROCESSING it should avoid that.
>
> What does the expression look like when you tried to syntax I suggested?
>
> -----Original Message-----
> From: mapserver-users [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Janne Tuovinen
> Sent: Monday, November 07, 2016 9:08 AM
> To: mapserver-users at lists.osgeo.org
> Subject: Re: [mapserver-users] A problem with the Run-time substitution
>
> Thank you, but this doesn't work for me. The problem is that I want to pass a string value to my database, but the MapServer doesn't allow that and always passes the parameters value as an integer.
>
> -Janne
>
>
> 11/7/2016, 3:33 PM, Burgholzer, Robert (DEQ) wrote:
>> I believe that what you want is this:
>>
>>       PROCESSING "NATIVE_FILTER=param in '%param%' "
>>
>> I have not used the processing directive, so can not be sure, but the above syntax would work in a QUERY.
>>
>>
>> -----Original Message-----
>> From: mapserver-users [mailto:mapserver-users-bounces at lists.osgeo.org] 
>> On Behalf Of Janne Tuovinen
>> Sent: Monday, November 07, 2016 7:36 AM
>> To: mapserver-users at lists.osgeo.org
>> Subject: [mapserver-users] A problem with the Run-time substitution
>>
>> Hi,
>>
>> I have a problem when I'm trying to pass a url-parameter to Postgis query's NATIVE_FILTER in my map file.
>>
>> My layer looks something like this:
>>
>>   LAYER
>>      ...
>>       VALIDATION
>>           'param' '.+'
>>       END
>>       ...
>>       DATA "shape from table"
>>       PROCESSING "NATIVE_FILTER=param in %param%"
>>
>>    END # LAYER
>>
>> Here is some examples what I get when I try to pass some values: 
>>
>> ...&param=1000   = > (param in (1000))
>> ...&param='1000' = > (param in (%param%))
>>
>> What I like to have is: (param in ('1000'))
>>
>> Is there a way to this with the MapServer 7.0?
>>
>> Thank you,
>> Janne
>>
>> _______________________________________________
>> 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
>
> _______________________________________________
> 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
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users





More information about the MapServer-users mailing list