Created
          December 4, 2017 10:46 
        
      - 
      
- 
        Save loomismilitia/450c0be3ffc8acc81e667b5fd690beba to your computer and use it in GitHub Desktop. 
    MySql Loop
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | drop procedure if exists doWhile; | |
| SET @counter=5000; | |
| CREATE PROCEDURE doWhile() | |
| BEGIN | |
| DECLARE i INT DEFAULT 0; | |
| WHILE (i <= @counter) DO | |
| INSERT INTO `test` (name) values ('loop sample'); | |
| SET i = i+1; | |
| END WHILE; | |
| END; | |
| CALL doWhile(); | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment