[postgis-users] Selecting which table column to update
Bob Pawley
rjpawley at shaw.ca
Mon Sep 24 10:42:10 PDT 2012
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20120924/d226da57/attachment.html>
More information about the postgis-users
mailing list