From 7e4049d27d879af20e6e1239a53cb6643349e592 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Tue, 13 Apr 2021 12:48:09 -0400 Subject: [PATCH] set item master attributes prior to anythign else --- build/convert_pool_all.sql | 59 +++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/build/convert_pool_all.sql b/build/convert_pool_all.sql index 491ed4e..95df7af 100644 --- a/build/convert_pool_all.sql +++ b/build/convert_pool_all.sql @@ -114,6 +114,35 @@ SELECT FROM rlarp.osm_pool; +-------need to set item master values before other things----------- +UPDATE + RLARP.OSMFS_DEV O +SET + COLC = M.COLC + ,COLGRP = M.COLGRP + ,COLTIER = M.COLTIER + ,COLSTAT = M.COLSTAT + ,SIZC = M.SIZC + ,PCKG = M.PACKAGE + ,KIT = M.KIT + ,BRND = M.BRANDING + ,MAJG = M.MAJG + ,MING = M.MING + ,MAJS = M.MAJS + ,MINS = M.MINS + ,GLDC = M.GLCD + ,GLEC = M.GLEC + ,HARM = M.HARM + ,CLSS = M.CLSS + ,BRAND = M.BRAND + ,ASSC = M.ASSC + ,LBS = CASE M.NWUN WHEN 'KG' THEN 2.2046 ELSE 1 END*M.NWHT + ,UNTI = M.UNTI +FROM + RLARP.ITEMM M +WHERE + M.ITEM = O.PART; + WITH plist AS ( @@ -140,8 +169,6 @@ plist AS ( ir.y0part = p.part AND ir.y0plnt = p.plnt ) - - UPDATE rlarp.osmfs_dev o SET @@ -397,34 +424,6 @@ WHERE --WHERE -- c_currency = 'US'; -UPDATE - RLARP.OSMFS_DEV O -SET - COLC = M.COLC - ,COLGRP = M.COLGRP - ,COLTIER = M.COLTIER - ,COLSTAT = M.COLSTAT - ,SIZC = M.SIZC - ,PCKG = M.PACKAGE - ,KIT = M.KIT - ,BRND = M.BRANDING - ,MAJG = M.MAJG - ,MING = M.MING - ,MAJS = M.MAJS - ,MINS = M.MINS - ,GLDC = M.GLCD - ,GLEC = M.GLEC - ,HARM = M.HARM - ,CLSS = M.CLSS - ,BRAND = M.BRAND - ,ASSC = M.ASSC - ,LBS = CASE M.NWUN WHEN 'KG' THEN 2.2046 ELSE 1 END*M.NWHT - ,UNTI = M.UNTI -FROM - RLARP.ITEMM M -WHERE - M.ITEM = O.PART; - --DELETE FROM rlarp.osmf_dev WHERE iter IN ('adj price','adj volume'); --INSERT INTO rlarp.osmf_dev SELECT * FROM rlarp.osmfs_dev;