Skip to main content

Posts

Showing posts from November, 2011

Mysql: Multiple loop cursor in procedure

DELIMITER $$ DROP PROCEDURE IF EXISTS `updatequestion` $$ CREATE DEFINER=`root`@`localhost` PROCEDURE `updatequestion`()  BLOCK1: begin      declare v_col1 int;      declare no_more_rows1 boolean default FALSE;      declare cursor1 cursor for          select col1          from   MyTable;      declare continue handler for not found          set no_more_rows1 := TRUE;      open cursor1;      LOOP1: loop          fetch cursor1          into  v_col1;          if no_more_rows1 then              close cursor1;         ...