You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

38 lines
790 B

-- 1/3 : Création de la table temporaire
DROP TABLE IF EXISTS w_dbsetup
;
CREATE TEMP TABLE w_dbsetup AS
SELECT
t_dashboard_onglet.oid,
t_dashboard.code as dashboard_code,
name,
index
FROM rh.t_dashboard_onglet
LEFT JOIN rh.t_dashboard ON t_dashboard.oid = dashboard_id
ORDER BY 2, 4 LIMIT 0
;
-- 2/3 : Peuplement de la table temporaire
INSERT INTO w_dbsetup(
oid,
dashboard_code,
name,
index
)
VALUES
(1, 'CTI_EGAPRO', 'Effectif', 0),
(1, 'CTI_EGAPRO', 'Masse Salariale', 1)
;
-- 3/3 : Màj de la table iCTI
TRUNCATE rh.t_dashboard_onglet;
INSERT INTO rh.t_dashboard_onglet(dashboard_id, name, index)
SELECT
t_dashboard.oid,
w_dbsetup.name,
w_dbsetup.index
FROM w_dbsetup
LEFT JOIN rh.t_dashboard ON t_dashboard.code = dashboard_code
;