feat: refs #7681 Optimization and refactor #2707

Merged
guillermo merged 7 commits from 7681-routeUpdateM3 into dev 2024-07-19 11:12:22 +00:00
1 changed files with 0 additions and 4 deletions
Showing only changes of commit a2f2ed743d - Show all commits

View File

@ -8,16 +8,12 @@ BEGIN
*
* @param vSelf Id ruta
*/
CREATE OR REPLACE TEMPORARY TABLE tRouteVolume
guillermo marked this conversation as resolved Outdated

No es necesario generar un tabla, solo es una variable

No es necesario generar un tabla, solo es una variable
ENGINE = MEMORY
SELECT IFNULL(SUM(volume), 0) volume
FROM saleVolume
WHERE routeFk = vSelf;
-- Hago el INTO para que no de error en los triggers
SELECT id INTO vSelf FROM `route` WHERE id = vSelf FOR UPDATE;
UPDATE `route`
SET m3 = (SELECT volume FROM tRouteVolume)
WHERE id = vSelf;