[postgis-users] Selecting which table column to update
Hernan Alperin
hernan.alperin at gmail.com
Mon Sep 24 11:04:11 PDT 2012
bob.
you forgot to name what column you want to set. among other problems with
sql syntax.
update table set column_name = expresion ...
the column_name cannot be an expression, should be an l-value.
checkout sql syntax in postgres.org
-h
2012/9/24 Bob Pawley <rjpawley at shaw.ca>
> Hi
>
> I am attempting to update a table column that is to be determined by a
> linestring being above, below or to the right of an intersection.
>
> update pipe
> set
> case when st_centroid(bob.edge_data.geom) >> num_search.the_geom9
> where bob.edge_data.edge_id <> pipe.edge
> and pipe.id =10
> then branch_right_id =
>
> when st_centroid(bob.edge_data.geom) |>> num_search.the_geom9
> bob.edge_data.edge_id <> pipe.edge
> and pipe.id =10
> then branch_up_id =
>
> when st_centroid(bob.edge_data.geom) <<| num_search.the_geom9
> bob.edge_data.edge_id <> pipe.edge
> and pipe.id =10
> then branch_down_id =
>
> end
> (select bob.edge_data.edge_id
> from bob.edge_data, num_search, pipe
> where st_intersects(bob.edge_data.geom, num_search.the_geom9))
> --intersection of max edge collected in pipe table
> where pipe.id = 10;
>
> Following is the error-
> ERROR: syntax error at or near "case"
> LINE 3: case when st_centroid(bob.edge_data.geom) >> num_search.the...
>
> Can this be done?
>
> Bob
>
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
--
-h
Una posición política:
ni a la izquierda ni a la derecha (mucho menos en el centro),
ni arriba ni abajo (mucho menos en el medio),
ni adentro ni afuera (mucho menos en el borde),
ni a la vanguardia ni en la retaguardia (mucho menos en el montón),
ni avanzando ni retrocediendo (mucho menos quieto),
ni en lo alto ni en lo profundo (mucho menos en el piso).
Simplemente con el eje en otra dimensión.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20120924/f0d4b2d3/attachment.html>
More information about the postgis-users
mailing list