[postgis-users] Trigger updata lines

Broun Uganda tekuganda at hotmail.com
Tue Aug 14 13:24:44 PDT 2007

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.
CREATE OR REPLACE FUNCTION update_links() RETURNS "trigger"    AS 'DECLAREstarts character varying;ends character varying;BEGINstarts = NEW.name WHERE nodes.name = links.from_node;ends = NEW.name WHERE nodes.name = links.to_node;UPDATE links SET the_geom = GeometryFromtext(starts.the_geom,ends.the_geom) ;RETURN NEW;END'    LANGUAGE plpgsql;
CREATE TRIGGER update_links_update  AFTER UPDATE  ON nodes  FOR EACH ROW  EXECUTE PROCEDURE update_links();
Thanks for your help
Broun Emmanuel
Play free games, earn tickets, get cool prizes! Join Live Search Club. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20070814/03e5e28b/attachment.html>

More information about the postgis-users mailing list