Re: Help with failing Postgis query...

Stephen Woodbridge <[email protected]>
Newsgroups gmane.comp.gis.mapserver.user
Message-ID <[email protected]>
Brent,

Are you wrapping your query like:

DATA "select * from (select ROW_NUMBER() OVER (order by code) as id, 
code, sci_name, com_name, lower(family_com)||' ('|| family_sci||')' as 
Family, point from rdb.species_master s, maps.null_point p where code in 
(select distinct species from trawl.t_catch) limit 10) as foo using 
unique id using srid=4326"

where srid is appropriate for your data?

-Steve W

On 2/10/2019 7:51 PM, Brent Wood wrote:
>
> Hi,
>
>
> I'm getting an error with an SQL in a mapfile.
>
>
> The query works from from the command line:
>
>
> select ROW_NUMBER() OVER (order by code) as id, code, sci_name, 
> com_name, lower(family_com)||' ('|| family_sci||')' as Family, point 
> from rdb.species_master s, maps.null_point p where code in (select 
> distinct species from trawl.t_catch) limit 10 ;
>
>
> id,code,sci_name,com_name,family,locn
> 1,AAT,Alainopasiphaea australis,Alainopasiphaea 
> australis,,0101000020E610000000000000000000000000000000000000
>
> ...
>
>
> When embedded in a mapfile & invoked from a browser or QGIS I get an 
> error:
>
>
> WFS server error. ms_error->code not found
> msPostGISLayerWhichShapes(): Query error. Error executing query.
>
>
>
> Any suggestions?
>
>
> Brent Wood
>
> Programme leader: Environmental Information Delivery
> NIWA
> DDI:  +64 (4) 3860529
>
>
> <http://www.niwa.co.nz>
>
> 	
> Brent Wood
> Principal Technician - GIS and Spatial Data Management
> Programme Leader - Environmental Information Delivery
> T +64-4-386-0529 		
>
> National Institute of Water & Atmospheric Research Ltd (NIWA)
> 301 Evans Bay Parade, Greta Point, Wellington
> Connect with NIWA: niwa.co.nz <https://www.niwa.co.nz>Facebook 
> <https://www.facebook.com/nzniwa>Twitter 
> <https://twitter.com/niwa_nz>LinkedIn 
> <https://www.linkedin.com/company/niwa>Instagram 
> <https://www.instagram.com/niwa_science>
>
> To ensure compliance with legal requirements and to maintain cyber 
> security standards, NIWA's IT systems are subject to ongoing 
> monitoring, activity logging and auditing. This monitoring and 
> auditing service may be provided by third parties. Such third parties 
> can access information transmitted to, processed by and stored on 
> NIWA's IT systems.
>
>
>
>
>
>
> _______________________________________________
> mapserver-users mailing list
> [email protected]
> https://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
[email protected]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.