Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with MySQL5 trigger calling procedure syntax

Status
Not open for further replies.

mbabcock

Programmer
Jul 25, 2006
32
US
I have an UPDATE trigger on my inventory_transactions table, set to call the spUpdateInventoryCounts procedure for the iInventoryID (FK) record being modified. Here's the code for my update trigger:

DELIMITER $$

DROP TRIGGER /*!50032 IF EXISTS */ sp_IT_Update$$

create trigger sp_IT_Update AFTER UPDATE on inventory_transactions
for each row BEGIN
DECLARE tiKey INT;
SET tiKey = inventory_transactions.iinventoryid;
CALL spUpdateInventoryCounts(tiKey);
END;
$$

DELIMITER ;

...yet when I modify a row in the Inventory_transactions table, I get an error saying "Error No. 1109
Unknown table 'inventory_transactions' in field list"

...but it's the freakin' table itself! The error would appear to be in this code, and not the spUpdateInventoryCounts because I dumbed that one down to simply say "update inventory set iqtyinstock=5" just to remove the possibility of that being the culprit.

Ugh....this should be simple but I'm just missing something....

Your help greatly appreciated!
--Michael
 
Nevermind....I needed to use OLD and NEW reference words....doh!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top