From d048a1fac6d18d7f274571fbf18c1f17ee68d521 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Tue, 7 Nov 2023 01:37:40 -0500 Subject: [PATCH] vault backup: 2023-11-07 01:37:40 --- sql/get_guidance.pg.sql | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sql/get_guidance.pg.sql b/sql/get_guidance.pg.sql index cf06353..4ae1b0c 100644 --- a/sql/get_guidance.pg.sql +++ b/sql/get_guidance.pg.sql @@ -15,6 +15,8 @@ DECLARE _cust text; _v1ds text; _v0ds text; + _v1tp jsonb; + _v0tp jsonb; _chan text; _regn text; _rslt jsonb; @@ -71,7 +73,7 @@ BEGIN stdev_price ) INTO - _targ + _v0tp FROM pricequote.market_setavgprice WHERE @@ -79,6 +81,7 @@ BEGIN AND season = _seas AND data_segment = _v0ds AND region = 'ALL'; + _rslt := _rslt||COALESCE(_v0tp,'{}'::jsonb); ----------------target pricing------------------------------ SELECT jsonb_build_object( @@ -88,7 +91,7 @@ BEGIN stdev_price ) INTO - _targ + _v1tp FROM pricequote.market_setavgprice WHERE @@ -97,7 +100,7 @@ BEGIN AND data_segment = _v1ds AND region = 'ALL'; --RAISE NOTICE 'target: %', jsonb_pretty(_targ); - _rslt := _rslt||COALESCE(_targ,'{}'::jsonb); + _rslt := _rslt||COALESCE(_v1tp,'{}'::jsonb); ----------------inflation index----------------------------- SELECT