[mapserver-users] postgis layer - postgresql table join eror
Stephen Woodbridge
woodbri at swoodbridge.com
Mon Aug 13 05:56:57 PDT 2012
Make sure you sub-query works ins psql or pgadmin first. You care
getting a SQL error not a mapserver error.
SELECT Pipeline.the_geom AS the_geom,
Pipeline.gid AS gid,
Pipeline.status AS status,
Kondur_block.id_wk AS id_wk
FROM Pipeline
LEFT JOIN Kondur_block
ON Pipeline.id_wk = Kondur_block.id_wk
If this does wotk there it will not work in mapserver.
-Steve W
On 8/13/2012 4:24 AM, surahman putra wrote:
> Thanks Thomas,
>
> But After I add FROM clause, it still give same message.
> Do you have any idea what should I do to fix this problem?
>
> Surahman
>
> On Mon, Aug 13, 2012 at 2:26 PM, thomas bonfort
> <thomas.bonfort at gmail.com <mailto:thomas.bonfort at gmail.com>> wrote:
>
> You're missing a FROM clause, probably something like:
>
> > DATA 'the_geom FROM (SELECT Pipeline.the_geom AS the_geom,
> Pipeline.gid AS
> > gid, Pipeline.status AS status, Kondur_block.id_wk AS id_wk
> FROM Pipeline
> > LEFT JOIN
> > Kondur_block ON Pipeline.id_wk = Kondur_block.id_wk) as subquery
> USING
> > UNIQUE gid USING srid=32648'
>
> --
> thomas
>
> On Mon, Aug 13, 2012 at 6:21 AM, Surahman Putra
> <surahmanputra at gmail.com <mailto:surahmanputra at gmail.com>> wrote:
> > Hi
> >
> >
> >
> > I’m new mapserver-user. I have problem to join postgis layer to
> postgre
> > table.
> >
> > Here my map file data:
> >
> >
> >
> > DATA 'the_geom FROM (SELECT Pipeline.the_geom AS the_geom,
> Pipeline.gid AS
> > gid, Pipeline.status AS status, Kondur_block.id_wk AS id_wk LEFT JOIN
> > Kondur_block ON Pipeline.id_wk = Kondur_block.id_wk) as subquery
> USING
> > UNIQUE gid USING srid=32648'
> >
> >
> >
> > And I get this message:
> >
> >
> >
> > msDrawMap(): Image handling error. Failed to draw layer named
> 'Pipeline'.
> > msPostGISLayerWhichShapes(): Query error. Error executing query:
> ERROR:
> > syntax error at or near "LEFT" LINE 1: ...".status AS status,
> > "Kondur_block".id_wk AS id_wk LEFT JOIN ... ^
> >
> >
> >
> > Can annyone sugget what’s wrong with that?
> >
> > For Information I use mapserver version 6.03 and postgis version
> 1.5.1
> >
> >
> >
> > Thanks,
> >
> > Surahman
> >
> >
> > _______________________________________________
> > 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
>
More information about the MapServer-users
mailing list