<html>
<head>
<style>
P
{
margin:0px;
padding:0px
}
body
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body><BR>I want to create a trigger that updates lines' geometry depending on the position of 2 points (from_node & to_node). If i move a point connecting two or more lines, the ends of lines should also move and follow the point. I wrote the following trigger but it gives me error that am giving multiple geometry.<BR>
<BR>
CREATE OR REPLACE FUNCTION update_links() RETURNS "trigger"<BR> AS <BR>'<BR>DECLARE<BR>starts character varying;<BR>ends character varying;<BR>BEGIN<BR>starts = NEW.name WHERE nodes.name = links.from_node;<BR>ends = NEW.name WHERE nodes.name = links.to_node;<BR>UPDATE links SET the_geom = GeometryFromtext(starts.<FONT face="">the_geom</FONT>,ends.the_geom) ;<BR>RETURN NEW;<BR>END'<BR> LANGUAGE plpgsql;<BR>
CREATE TRIGGER update_links_update<BR> AFTER UPDATE<BR> ON nodes<BR> FOR EACH ROW<BR> EXECUTE PROCEDURE update_links();<BR>
<BR>
<BR>
Thanks for your help<BR>
Broun Emmanuel<BR><br /><hr />Live Earth is coming. Learn more about the hottest summer event - only on MSN. <a href='http://liveearth.msn.com?source=msntaglineliveearthwlm' target='_new'>Check it out!</a></body>
</html>