[postgis-users] RE: Trigger updata lines
Broun Uganda
tekuganda at hotmail.com
Wed Aug 15 02:28:12 PDT 2007
Sorry the error i get is:
Query failed: ERROR: missing FROM-clause entry for table "nodes" ....
Broun Uganda
From: tekuganda at hotmail.comTo: postgis-users at postgis.refractions.netSubject: Trigger updata linesDate: Tue, 14 Aug 2007 23:24:44 +0300
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
Live Earth is coming. Learn more about the hottest summer event - only on MSN. Check it out!
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20070815/a8d8ec27/attachment.html>
More information about the postgis-users
mailing list