[mapserver-users] help passing runtime variables through cgi obfuscation script

Brent Wood pcreso at yahoo.com
Sun Feb 17 19:41:00 PST 2019


Thanks (again!! :-)
I'm trying to get runtime variable substitution working, without success.

I'm not getting an error message, but no data comes back... so the query is working OK, but the parameter substitution is nor happening...

The URL I'm using to test the service:localhost/cgi-bin/mapserv?map=trawl.map&species_code=RCO&version=2.0.0&srsname=EPSG:4326&typename=Selected_Species&service=wfs&request=getfeature
The layer DATA statement: DATA "startp from (select ROW_NUMBER() OVER (order by (t.trip_code, t.station_no)) as id, t.trip_code, t.station_no, species as code, sci_name, com_name, initcap(family_sci)||' ('|| initcap(family_com)||')' as Family, c.weight, ST_Shift_longitude(t.startp) as startp from trawl.t_station t, rdb.species_master s, trawl.t_catch c where c.species='%species_code%' and s.code = c.species and t.trip_code = c.trip_code and t.station_no=c.station_no ) as myquery using unique id using srid 4326"

The layer VALIDATION statement:    VALIDATION  
       #  spp code value is a 3 char upper case string
       'spp_code' '[A-Z][A-Z][A-Z]'
    END

The XML returned says: 
... numberMatched="0" numberReturned="0" ...

If I edit the data statement to: where c.species='RCO' (ie: hard code the value to RCO rather than pass it in - no other change) I get the desired response...
... numberMatched="7505" numberReturned="7505" ...

The mapserver log (when trying substitution):msPostGISLayerGetExtent(): General error message. msPostGISLayerGetExtent: Null result returned.
msQueryByRect(): Search returned no results. No matching record(s) found.


Can anyone suggest why my substitution is failing?

Thanks,
Brent Wood


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20190218/e90cb353/attachment.html>


More information about the mapserver-users mailing list