wrap in procedures
This commit is contained in:
parent
12787d297b
commit
4b477b990f
@ -1,3 +1,8 @@
|
||||
CREATE OR ALTER PROCEDURE pricing.rebuild_pricelist
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON;
|
||||
|
||||
DROP TABLE pricing.pricelist_ranged;
|
||||
|
||||
CREATE TABLE pricing.pricelist_ranged (
|
||||
@ -197,3 +202,4 @@ FROM
|
||||
ranged;
|
||||
|
||||
--CREATE INDEX pricelist_ranged_idx ON pricing.pricelist_ranged(jcpart, jcplcd, vb_from, vb_to);
|
||||
END;
|
@ -1,3 +1,8 @@
|
||||
CREATE OR REPLACE PROCEDURE pricequote.rebuild_pricelist()
|
||||
LANGUAGE plpgsql
|
||||
AS $$
|
||||
BEGIN
|
||||
|
||||
DROP TABLE IF EXISTS uomc;
|
||||
|
||||
CREATE TEMP TABLE uomc AS (
|
||||
@ -97,5 +102,7 @@ SELECT
|
||||
price
|
||||
FROM ranged;
|
||||
|
||||
END;
|
||||
$$;
|
||||
|
||||
CREATE INDEX pricelist_ranged_idx ON pricequote.pricelist_ranged ( jcpart ASC , jcplcd ASC , vb_from ASC , vb_to ASC ) ;
|
||||
--CREATE INDEX pricelist_ranged_idx ON pricequote.pricelist_ranged ( jcpart ASC , jcplcd ASC , vb_from ASC , vb_to ASC ) ;
|
@ -1,3 +1,7 @@
|
||||
CREATE OR ALTER PROCEDURE pricing.rebuild_targets
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON;
|
||||
|
||||
DELETE FROM pricing.target_prices;
|
||||
|
||||
@ -20,3 +24,5 @@ SELECT
|
||||
math
|
||||
FROM
|
||||
usmidsap02.ubm.pricequote.target_prices_view;
|
||||
|
||||
END;
|
Loading…
Reference in New Issue
Block a user