<HTML><HEAD></HEAD>
<BODY dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-FAMILY: 'Arial Narrow'; COLOR: #00002b; FONT-SIZE: 12pt">
<DIV>Hi</DIV>
<DIV> </DIV>
<DIV>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.</DIV>
<DIV> </DIV>
<DIV>update pipe</DIV>
<DIV> set </DIV>
<DIV> case when st_centroid(bob.edge_data.geom) >>
num_search.the_geom9</DIV>
<DIV> where bob.edge_data.edge_id
<> pipe.edge</DIV>
<DIV> and pipe.id =10</DIV>
<DIV> then branch_right_id =</DIV>
<DIV> </DIV>
<DIV> when
st_centroid(bob.edge_data.geom) |>> num_search.the_geom9</DIV>
<DIV> bob.edge_data.edge_id <>
pipe.edge</DIV>
<DIV> and pipe.id =10</DIV>
<DIV> then branch_up_id =</DIV>
<DIV> </DIV>
<DIV> when
st_centroid(bob.edge_data.geom) <<| num_search.the_geom9</DIV>
<DIV> bob.edge_data.edge_id <>
pipe.edge</DIV>
<DIV> and pipe.id =10</DIV>
<DIV> then branch_down_id =</DIV>
<DIV> </DIV>
<DIV> end </DIV>
<DIV> (select bob.edge_data.edge_id</DIV>
<DIV> from bob.edge_data, num_search,
pipe </DIV>
<DIV> where
st_intersects(bob.edge_data.geom, num_search.the_geom9)) --intersection of
max edge collected in pipe table </DIV>
<DIV> where pipe.id = 10; </DIV>
<DIV> </DIV>
<DIV>Following is the error-</DIV>
<DIV>ERROR: syntax error at or near "case"</DIV>
<DIV>LINE 3: case when st_centroid(bob.edge_data.geom) >>
num_search.the...</DIV>
<DIV> </DIV>
<DIV>Can this be done?</DIV>
<DIV> </DIV>
<DIV>Bob</DIV>
<DIV> </DIV>
<DIV> </DIV></DIV></DIV></BODY></HTML>