 begin -- ---------------------------------------------------- -- update from tables with productoid elementoid -- ---------------------------------------------------- update composicion asu800 t2u800 vidquoten3 asu800 t1u800 precios asu800 t3u800 productos asu800 t4u800 setu800 t1u800u82evidquoteprecio calculoprecio ancho alto case lista when 0u800 then t3u800u82eprecioprod00 when 1u800 then t3u800u82eprecioprod01 when 2u800 then t3u800u82eprecioprod02 when 3u800 then t3u800u82eprecioprod03 endu800 t4u800u82emagnitud t2u800u82eoffsetvanoalto t2u800u82eoffsetvanoancho t2u800u82ecoefvanoalto t2u800u82ecoefvanoancho t2u800u82evalorelemento coeficiente t1u800u82evidquotepreciop calculoprecio ancho alto case lista when 0u800 then t3u800u82eprecioprod00 when 1u800 then t3u800u82eprecioprod01 when 2u800 then t3u800u82eprecioprod02 when 3u800 then t3u800u82eprecioprod03 endu800 t4u800u82emagnitud t2u800u82eoffsetvanoalto t2u800u82eoffsetvanoancho t2u800u82ecoefvanoalto t2u800u82ecoefvanoancho t2u800u82evalorelemento coeficiente cantidad where t1u800u82evidquoteid presupuesto andu800 t1u800u82evidquoteitem presupuestoitem andu800 t1u800u82evidquoteprodid t1u800u82evidquoteelementoid andu800 t2u800u82eproductoid t1u800u82evidquoteprodid andu800 t2u800u82eelementoid t1u800u82evidquoteelementoid andu800 t2u800u82ecomposicid t1u800u82evidquotecomposicid andu800 t3u800u82eproductoid t2u800u82eelementoid andu800 t4u800u82eproductoid t3u800u82eproductoid; -- ---------------------------------------------------- -- update from tables with productoid elementoid -- ---------------------------------------------------- update vidquoten3 asu800 w1u800 select v1u800u82evidquoteprodid v1u800u82evidquoteelementoid v1u800u82evidquotecomposicid sumu800 calculoprecio ancho alto case lista when 0u800 then v4u800u82eprecioprod00 when 1u800 then v4u800u82eprecioprod01 when 2u800 then v4u800u82eprecioprod02 when 3u800 then v4u800u82eprecioprod03 endu800 v5u800u82emagnitud v2u800u82eoffsetvanoalto v3u800u82eoffsetvanoalto v2u800u82eoffsetvanoancho v3u800u82eoffsetvanoancho v2u800u82ecoefvanoalto v3u800u82ecoefvanoalto v2u800u82ecoefvanoancho v3u800u82ecoefvanoancho v2u800u82evalorelemento v3u800u82evalorelemento coeficiente asu800 vidquoteprecio sumu800 calculoprecio ancho alto case lista when 0u800 then v4u800u82eprecioprod00 when 1u800 then v4u800u82eprecioprod01 when 2u800 then v4u800u82eprecioprod02 when 3u800 then v4u800u82eprecioprod03 endu800 v5u800u82emagnitud v2u800u82eoffsetvanoalto v3u800u82eoffsetvanoalto v2u800u82eoffsetvanoancho v3u800u82eoffsetvanoancho v2u800u82ecoefvanoalto v3u800u82ecoefvanoalto v2u800u82ecoefvanoancho v3u800u82ecoefvanoancho v2u800u82evalorelemento v3u800u82evalorelemento coeficiente cantidad asu800 vidquotepreciop from fzggestionu82ecomposicion asu800 v3u800 fzggestionu82ecomposicion asu800 v2u800 fzggestionu82evidquoten3 asu800 v1u800 fzggestionu82eprecios asu800 v4u800 fzggestionu82eproductos asu800 v5u800 where v1u800u82evidquoteid presupuesto andu800 v1u800u82evidquoteitem presupuestoitem andu800 v3u800u82eproductoid v2u800u82eelementoid andu800 v2u800u82eproductoid v1u800u82evidquoteprodid andu800 v2u800u82eelementoid v1u800u82evidquoteelementoid andu800 v2u800u82ecomposicid v1u800u82evidquotecomposicid andu800 v4u800u82eproductoid v3u800u82eelementoid andu800 v5u800u82eproductoid v4u800u82eproductoid andu800 v1u800u82evidquoteprodid v1u800u82evidquoteelementoid andu800 v3u800u82eelementopm 0u800 group byu800 v1u800u82evidquoteelementoid v1u800u82evidquotecomposicid asu800 w2u800 setu800 w1u800u82evidquoteprecio w2u800u82evidquoteprecio w1u800u82evidquotepreciop w2u800u82evidquotepreciop where w2u800u82evidquoteprodid w1u800u82evidquoteprodid andu800 w2u800u82evidquoteelementoid w1u800u82evidquoteelementoid andu800 w2u800u82evidquotecomposicid w1u800u82evidquotecomposicid andu800 w1u800u82evidquoteid presupuesto andu800 w1u800u82evidquoteitem presupuestoitem andu800 w1u800u82evidquoteprodid w1u800u82evidquoteelementoid; endu800 