Hi,

Developers have paid attention to BINDVALS recently 
https://github.com/MapServer/MapServer/issues/6236 and they should work as in 
your mapfile.

The usage example is about string   "1"  "Nova Scotia". I wonder how a numeric 
bindvalue should be expressed in mapfile. Could it be that in the "1" "10" case 
the value gets converted into SQL string '10'? 

-Jukka Rahkonen-

-----Alkuperäinen viesti-----
Lähettäjä: mapserver-users <mapserver-users-boun...@lists.osgeo.org> Puolesta 
Fujioka (Duke)
Lähetetty: perjantai 26. maaliskuuta 2021 6.01
Vastaanottaja: mapserver-users@lists.osgeo.org
Aihe: [mapserver-users] BINVALS is supported by PostGIS 1.5?

Hello Mapserver experts!

I googled BINVALS but couldn't find any useful information.
What I want to achieve is to include a placeholder in DATA and substitute it 
using BINVALS.

Simplified example:
LAYER
CONNECTION "user=xxx password=xxx dbname=xxx host=xxx"
CONNECTIONTYPE POSTGIS
DEBUG 5
DATA "geom from (select column1, geom, count(*) from table1 where
column1 = $1 group by column1, geom) AS foo USING UNIQUE column1 USING 
SRID=4326"
BINDVALS
        "1"  "10"
END
END

I expect the final query would be "select ... where column1 = 10 group by ...". 
But the map image does not show anything. It's a gray image. 
When I set "DEBUG 5" at the layer level and took a look at the debug info, the 
placeholder was not substituted (it was still "where column1 = $1..."). So, it 
seems BINDVALS is not working.

Any tips on this? Does the complexity of the query matter (e.g. can't use GROUP 
BY or JOIN)? Should the query in the debug info be the final one with the 
placeholder substituted with the value specified in BINDVALS?

I use Mapserver 6.4 & PostGIS 1.5 & PostgreSQL 9.1. Is BINDVALS not supported 
for these versions?
Also, how can I change the bind value using PHP Mapscript (say, from "10" to 
"20")?

Thanks,

--
========================
   Ei Fujioka
   Research Scientist
   Nicholas School
   Duke University

   (919) 684-3518
   efuji...@duke.edu
========================

_______________________________________________
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users
_______________________________________________
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to