Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

triggers insert into cor_observer_synthese #762

Closed
jbrieuclp opened this issue Oct 22, 2019 · 0 comments
Closed

triggers insert into cor_observer_synthese #762

jbrieuclp opened this issue Oct 22, 2019 · 0 comments
Labels

Comments

@jbrieuclp
Copy link
Contributor

J'ai l'impression que le trigger pr_occtax.fct_tri_synthese_insert_counting() et pr_occtax.fct_tri_synthese_insert_cor_role_releve() font le même taf, à savoir intégrer les id_role en lien avec l'id_synthese dans la table gn_synthese.cor_observer_synthese en AFTER INSERT uniquement.
Le trigger associé à cor_role_releves_occtax devrait être supprimé en prio pour permettre un enregistrement par étape sans mettre la zone dans la synthèse :)

C'est ici pour fct_tri_synthese_insert_cor_role_releve

CREATE OR REPLACE FUNCTION fct_tri_synthese_insert_cor_role_releve()

CREATE OR REPLACE FUNCTION pr_occtax.fct_tri_synthese_insert_cor_role_releve()

Et ici pour la seconde
IF myobservers IS NOT NULL THEN
INSERT INTO gn_synthese.cor_observer_synthese (id_synthese, id_role)
SELECT
id_synthese,
unnest(myobservers)
FROM gn_synthese.synthese WHERE unique_id_sinp = NEW.unique_id_sinp_occtax;
END IF;
RETURN NULL;
END;

IF myobservers IS NOT NULL THEN
INSERT INTO gn_synthese.cor_observer_synthese (id_synthese, id_role)
SELECT
id_synthese,
unnest(myobservers)
FROM gn_synthese.synthese WHERE unique_id_sinp = NEW.unique_id_sinp_occtax;
END IF;
RETURN NULL;
END;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants