convert script to live db and do rounding on final build

This commit is contained in:
Paul Trowbridge 2021-05-03 12:33:34 -04:00
parent f2b6686f3e
commit 032736f0e9
2 changed files with 11 additions and 11 deletions

View File

@ -121,11 +121,11 @@ SELECT
,r_rate ,r_rate
,c_currency ,c_currency
,c_rate ,c_rate
,fb_qty units ,round(fb_qty,2) units
,fb_val_loc value_loc ,round(fb_val_loc,2) value_loc
,fb_val_loc * r_rate value_usd ,round(fb_val_loc * r_rate,2) value_usd
,fb_cst_loc_cur cost_loc ,round(fb_cst_loc_cur,2) cost_loc
,fb_cst_loc_cur * c_rate cost_usd ,round(fb_cst_loc_cur * c_rate,2) cost_usd
,calc_status ,calc_status
,flag ,flag
,o.odate order_date ,o.odate order_date
@ -171,7 +171,7 @@ FROM
--LIMIT 100 --LIMIT 100
) WITH DATA; ) WITH DATA;
INSERT INTO rlarp.osm_pool SELECT * FROM rlarp.osm_pool_stage; --INSERT INTO rlarp.osm_pool SELECT * FROM rlarp.osm_pool_stage;
--CREATE INDEX osm_qr ON rlarp.osm_pool(quota_rep_descr, bill_cust_descr, ship_cust_descr); --CREATE INDEX osm_qr ON rlarp.osm_pool(quota_rep_descr, bill_cust_descr, ship_cust_descr);
--ALTER TABLE rlarp.osm_pool ADD CONSTRAINT logfk FOREIGN KEY (logid) REFERENCES rlarp.osm_log(id); --ALTER TABLE rlarp.osm_pool ADD CONSTRAINT logfk FOREIGN KEY (logid) REFERENCES rlarp.osm_log(id);

View File

@ -1,5 +1,5 @@
$PGD -f ./build_stage.sql $PG -f ./build_stage.sql
$PGD -f ./snap_itemm.sql $PG -f ./snap_itemm.sql
$PGD -f ./snap_cost_current.sql $PG -f ./snap_cost_current.sql
$PGD -f ./snap_customer.sql $PG -f ./snap_customer.sql
$PGD -f ./build_pool.sql $PG -f ./build_pool.sql