-
delete action on mysql bt trigger
Hi all, I want to what ever I delete on table1 also delete on transaction_log , the connecction with UserId , the following code is not work, I use Mysql 5.0
delimiter $$
CREATE TRIGGER DeleteTrigger
ON tabl1
FOR delete
BEGIN
delete transaction_log from transaction_log,
deleted where transaction_log.userId=deleted.User.Id;
END$$
delimiter ;
________
Og Kush Pictures
Last edited by sql; 03-06-2011 at 02:10 AM.
-
Try this on your test server.
delimiter $$
CREATE TRIGGER DeleteTrigger
ON tabl1
FOR delete
BEGIN
delete transaction_log from transaction_log,
deleted where transaction_log.userId=deleted.UserId;
END$$
delimiter ;
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|