Skip to content

Instantly share code, notes, and snippets.

@mikelemus27
Created July 10, 2020 05:45
Show Gist options
  • Save mikelemus27/8857e3208ac27cdd5161fb5fa474da46 to your computer and use it in GitHub Desktop.
Save mikelemus27/8857e3208ac27cdd5161fb5fa474da46 to your computer and use it in GitHub Desktop.
DELIMITER $$
CREATE PROCEDURE `my_proc_LOOP` (IN num INT)
BEGIN
DECLARE x INT;
SET x = 0;
loop_label: LOOP
INSERT INTO number VALUES (rand());
SET x = x + 1;
IF x >= num
THEN
LEAVE loop_label;
END IF;
END LOOP;
END$$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment