MySQL Forums
Forum List  »  Triggers

delete trigger error.
Posted by: Rob Thompson
Date: August 21, 2008 03:40AM

I have a very strange error on a simple trigger.

here is the trigger:

create trigger trDeletePoItem
before delete on tblPoItem for each row
begin
INSERT INTO PurchaseOrder.tblPoAudit
SET
intPoId = OLD.intPoId,
intProductMasterId = OLD.intProductMasterId,
intUserId = @intUserId,
intActionTypeId = FnGetPoActionId('PoItemDeleted');
end$$

The trigger compiles but I get the following error when trying to use it.
mysql> set @intUserId =1;
Query OK, 0 rows affected (0.00 sec)
mysql> truncate tblPoItem;
ERROR 1146 (42S02): Table 'PurchaseOrder.tblPoAudit' doesn't exist

Howerver:
mysql> describe PurchaseOrder.tblPoAudit;

Shows me that the table does exist.I have both insert and update triggers on that table which insert into the same audit table. I have also tried changing the 'before' to 'after'

thanks for any help

Options: ReplyQuote


Subject
Views
Written By
Posted
delete trigger error.
6623
August 21, 2008 03:40AM
2107
August 21, 2008 01:57PM
2181
August 26, 2008 07:31AM
2048
August 29, 2008 01:26AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.