SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 trigger
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Keshaba
Yak Posting Veteran

India
52 Posts

Posted - 06/21/2011 :  09:37:37  Show Profile  Send Keshaba a Yahoo! Message  Reply with Quote
Hi i am creating a trigger in mysql as given below but it is giving me errors 'Can't update chat_master in stored function / trigger because it is already used by statement which invoked this stored procedure trigger


delimiter $
CREATE TRIGGER myTrigger
After INSERT ON chat_master
FOR EACH ROW
BEGIN
DECLARE row_count INTEGER;

SELECT COUNT(*)
INTO row_count
FROM chat_master
WHERE UM_master_id=NEW.UM_master_id;
IF row_count > 0 THEN
delete from chat_master where UM_master_id=1;
END IF;
end $$

Can anybody help

Keshab

russell
Pyro-ma-ni-yak

USA
5072 Posts

Posted - 06/21/2011 :  09:43:47  Show Profile  Visit russell's Homepage  Reply with Quote
No need to make two posts for the same problem.

Also, you'll have better luck on a mySQL forum than here. We specialize in Microsoft SQL Server here.

Might try this one: http://forums.mysql.com/
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000