[mapserver-users] variable substitution

Lime, Steve D (MNIT) Steve.Lime at state.mn.us
Wed Jan 4 17:24:19 PST 2017


I should also add that you should add anchors (^$) to your validation expression. Just using "[0-9]" will match "111" but also "111; do something nasty in SQL". So "^[0-9]*$" is much better.

Steve

________________________________________
From: Lime, Steve D (MNIT)
Sent: Wednesday, January 04, 2017 9:01 AM
To: Stephen Woodbridge; mapserver-users at lists.osgeo.org
Subject: RE: [mapserver-users] variable substitution

Actually you don't want the []'s around the substitution as they denote a column reference. '%adrkey%' or %adrkey% should suffice depending on the type of comparison being done. --Steve

________________________________________
From: mapserver-users [mapserver-users-bounces at lists.osgeo.org] on behalf of Stephen Woodbridge [woodbri at swoodbridge.com]
Sent: Wednesday, January 04, 2017 8:53 AM
To: mapserver-users at lists.osgeo.org
Subject: Re: [mapserver-users] variable substitution

Or use:
FILTER ( "[gid]" = '[%adrkey%]' )

" for the column name
' for the value

-Steve W

On 1/4/2017 6:47 AM, thomas bonfort wrote:
> yeah, if you want an integer comparison use:
> FILTER ( [gid] = [%adrkey%] )
>
>
> On Wed, Jan 4, 2017 at 12:43 PM Jörg Thomsen (WhereGroup)
> <joerg.thomsen at wheregroup.com <mailto:joerg.thomsen at wheregroup.com>> wrote:
>
>     Hello Thomas,
>
>     Am 04.01.2017 um 12:34 schrieb thomas bonfort:
>     > FILTER ( "[gid]" = "[%adrkey%]" )
>
>     this doesn't work, ms puts the value into quotes so PG interprets it as
>     a column-name.
>     > [Wed Jan  4 12:40:04 2017].714496 msPostGISLayerWhichShapes():
>     Error (ERROR:  column "2" does not exist
>     > LINE 1: select
>     "beschriftung","gid","2",encode(ST_AsBinary(ST_Force2...
>
>     But the Filteritem / Filter solution is ok.
>
>     Viele Grüße,
>     Jörg Thomsen
>
>     --
>
>     *********************************************************
>     FOSS Academy Winterschule 2017
>     20.-24.03.2017 in Bonn
>     Alles Wichtige zur Erstellung einer GDI in nur 5 Tagen!
>     https://www.foss-academy.com/schulungstermine/kompaktkurs-winterschule
>     *********************************************************
>
>     -------------------------------
>     Jörg Thomsen
>     WhereGroup GmbH & Co. KG
>     Gillweg 3
>     14193 Berlin
>     Germany
>
>     Fon: +49 (0)30 / 5130 278 74 <tel:+49%2030%20513027874>
>     Fax: +49 (0)30 / 89 09 53 21 <tel:+49%2030%2089095321>
>
>     joerg.thomsen at wheregroup.com <mailto:joerg.thomsen at wheregroup.com>
>     www.wheregroup.com <http://www.wheregroup.com>
>     Amtsgericht Bonn, HRA 6788
>     -------------------------------
>     Komplementärin:
>     WhereGroup Verwaltungs GmbH
>     vertreten durch:
>     Olaf Knopp, Peter Stamm
>     -------------------------------
>     Folgen Sie der WhereGroup auf twitter: http://twitter.com/WhereGroup_com
>     _______________________________________________
>     mapserver-users mailing list
>     mapserver-users at lists.osgeo.org <mailto: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
>


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

_______________________________________________
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