martes, 11 de mayo de 2010

MySQL: STORE PROCEDURE

DELIMITER $$

DROP PROCEDURE IF EXISTS `test`.`pp`$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `pp`()
BEGIN
DECLARE v INT;
SET v = 0;
WHILE v < 5 DO
INSERT INTO test (NAME) VALUES ('asd.jpg');
SET v = v +1 ;
END WHILE;

END$$

DELIMITER ;



CALL pp();

No hay comentarios:

Publicar un comentario