Skip to content

Instantly share code, notes, and snippets.

@bisby
Last active January 6, 2016 22:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bisby/1822b76e27759d1a5f7c to your computer and use it in GitHub Desktop.
Save bisby/1822b76e27759d1a5f7c to your computer and use it in GitHub Desktop.
DECLARE i INT;
DECLARE cur CURSOR FOR SELECT blog_id FROM wp_blogs;
OPEN cur;
read_loop: LOOP
FETCH cur INTO i;
IF done THEN
LEAVE read_loop;
END IF;
yourFunction(i);
END LOOP;
CLOSE cur;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment