2024-01-15 11:31:03 +00:00
|
|
|
DELIMITER $$
|
2024-07-22 09:52:42 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`vn-admin`@`localhost` PROCEDURE `vn`.`workerForAllCalculateBoss`()
|
2024-01-15 11:31:03 +00:00
|
|
|
BEGIN
|
|
|
|
/**
|
|
|
|
* Actualiza la tabla workerBosses utilizando el procedimiento
|
|
|
|
* vn.workerCalculateBoss(), actualiza todos los trabajadores en esa tabla
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
DECLARE vWorker INT;
|
|
|
|
DECLARE vDone BOOL;
|
|
|
|
|
|
|
|
DECLARE cur CURSOR FOR
|
|
|
|
SELECT id FROM worker;
|
|
|
|
|
|
|
|
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
|
|
|
|
|
|
|
|
OPEN cur;
|
|
|
|
|
|
|
|
l: LOOP
|
|
|
|
SET vDone = FALSE;
|
|
|
|
FETCH cur INTO vWorker;
|
|
|
|
|
|
|
|
IF vDone THEN
|
|
|
|
LEAVE l;
|
|
|
|
END IF;
|
|
|
|
|
|
|
|
CALL workerCalculateBoss(vWorker);
|
|
|
|
END LOOP;
|
|
|
|
|
|
|
|
CLOSE cur;
|
|
|
|
|
|
|
|
END$$
|
|
|
|
DELIMITER ;
|