MySQL New Features Cursor Example: CREATE PROCEDURE p25 (OUT return_val INT)BEGINDECLARE a,b INT;DECLARE cur_1 CURSOR FOR SELECT s1 FROM t;DECLARE CONTINUE HANDLER FOR NOT FOUND < --SET b = 1; <--OPEN cur_1;REPEATFETCH cur_1 INTO a;UNTIL b = 1END REPEAT;CLOSE cur_1;SET return_val = a;END;// Stored procedure in MySQL http://www.mysqltutorial.org/stored-procedures-loop.aspx Loop in stored procedure DELIMITER $$ DROP […]

Read more of this post