I am trying to use triggers for the first time with MySQL 5.0. I have read
the manual but I am not understanding why I would run into the following
problem.

I created the following triggers:

CREATE TRIGGER UpdPopCoord AFTER UPDATE ON locations FOR EACH ROW
UPDATE locations, zipcodes
SET locations.lat=zipcodes.lat, locations.lon=zipcodes.lon
WHERE  (locations.zip=zipcodes.zip AND (locations.lat IS NULL) AND
(locations.lon is NULL));

CREATE TRIGGER InsPopCoord AFTER INSERT ON locations FOR EACH ROW
UPDATE locations, zipcodes
SET locations.lat=zipcodes.lat, locations.lon=zipcodes.lon
WHERE  (locations.zip=zipcodes.zip AND (locations.lat IS NULL) AND
(locations.lon is NULL));

Upon insert or update I get the following error:

ERROR 1442 (HY000): Can't update table 'locations' in stored
function/trigger because it is already used by statement which invoked this
stored function/trigger.

What exactly is the meaning of this? Is there no way around this? I only
want to update the one that was just inserted/updated.



Thanks

Steffan

---------------------------------------------------------------
T E L  6 0 2 . 5 7 9 . 4 2 3 0 | F A X  6 0 2 . 9 7 1 . 1 6 9 4
Steffan A. Cline
[EMAIL PROTECTED]                             Phoenix, Az
http://www.ExecuChoice.net                                  USA
AIM : SteffanC          ICQ : 57234309
The Executive's Choice in Lasso driven Internet Applications
                                  Lasso Partner Alliance Member
---------------------------------------------------------------



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to