7806_devToTest_2332 #2801
|
@ -8,16 +8,12 @@ BEGIN
|
||||||
*
|
*
|
||||||
* @param vSelf Id ruta
|
* @param vSelf Id ruta
|
||||||
*/
|
*/
|
||||||
|
|
||||||
CREATE OR REPLACE TEMPORARY TABLE tRouteVolume
|
CREATE OR REPLACE TEMPORARY TABLE tRouteVolume
|
||||||
ENGINE = MEMORY
|
ENGINE = MEMORY
|
||||||
SELECT IFNULL(SUM(volume), 0) volume
|
SELECT IFNULL(SUM(volume), 0) volume
|
||||||
FROM saleVolume
|
FROM saleVolume
|
||||||
WHERE routeFk = vSelf;
|
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`
|
UPDATE `route`
|
||||||
SET m3 = (SELECT volume FROM tRouteVolume)
|
SET m3 = (SELECT volume FROM tRouteVolume)
|
||||||
WHERE id = vSelf;
|
WHERE id = vSelf;
|
||||||
|
|
Loading…
Reference in New Issue