Featured Post

Event Sourcing Video from Michael Ploed

Event Sourcing I want to share a great video I found few days ago that describes very well what Event Sourcing is.

Thursday, January 11, 2018

MYSQL FUNCTION




DELIMITER $$
CREATE PROCEDURE insertIntoTable(IN NumRows INT)
    BEGIN
        DECLARE i INT;
        SET i = 1;
        START TRANSACTION;
     WHILE i <= NumRows DO
      INSERT INTO `TableOne` (`ID`,`DATE`,`EXT_PLATFORM_PARENT_ID`) VALUES (i,sysdate());
          SET i = i + 1;
        END WHILE;
  COMMIT;
    END$$
DELIMITER ;

DELIMITER $$
CREATE PROCEDURE insertThread(IN NumRows INT)
 BEGIN
  DECLARE i INT;
        SET i = 1;
   WHILE i <= NumRows DO
   CALL insertIntoTable(2000);
   SET i = i + 1;
   END WHILE;
    END$$
DELIMITER ;

CALL insertIntoTable(20);


No comments :

Post a Comment