MySQL Forums :: Stored Procedures :: Mysql Stored Procedure or routine crashes wamp server


Advanced Search

Mysql Stored Procedure or routine crashes wamp server
Posted by: Rishwanth K M ()
Date: January 17, 2017 01:08AM

I have a stored procedure or routine which selects data from a view and inserts into a table.
the code is as below:

BEGIN

DECLARE flag INT DEFAULT 0;
DECLARE p_email,p_pwd,p_status VARCHAR(100);

DECLARE cur_1 CURSOR FOR

SELECT `email`, `pwd`, `status` FROM `vw_empdetails`;


DECLARE CONTINUE HANDLER FOR NOT FOUND SET flag = 1;

OPEN cur_1;
doInsert: LOOP
FETCH cur_1 INTO p_email,p_pwd,p_status;
IF flag = 1 THEN
LEAVE doInsert;
END IF;

INSERT INTO `common_login_user_master` set `login_username`=p_email, `pwd`=p_pwd, `super_admin_type`=2, `active_status`=p_status ON DUPLICATE KEY UPDATE `login_username`=p_email, `pwd`=p_pwd, `super_admin_type`=2, `active_status`=p_status;


END LOOP doInsert;

CLOSE cur_1;
END


the above procedure is called using a mysql event scheduler as below:

CREATE DEFINER=`root`@`localhost` EVENT `Event Handler1` ON SCHEDULE EVERY 20 SECOND STARTS '2017-01-16 12:18:17' ON COMPLETION NOT PRESERVE ENABLE DO call Proc_Update_LoginDetails()

when the event scheduler runs the wamp server stops and the icon of wamp server changes to orange.

Any help would be appreciated..

Options: ReplyQuote


Subject Views Written By Posted
Mysql Stored Procedure or routine crashes wamp server 827 Rishwanth K M 01/17/2017 01:08AM
Re: Mysql Stored Procedure or routine crashes wamp server 97 Peter Brawley 01/17/2017 03:25AM


Sorry, only registered users may post in this forum.

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.