-
Notifications
You must be signed in to change notification settings - Fork 3
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
Integration rpg #110
base: master
Are you sure you want to change the base?
Integration rpg #110
Conversation
fichier d'import des données du RPG
traitement des données.
Mise à jour du fichier pour ajouter les commentaires des tables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quelques petites coquilles à corriger.
@@ -0,0 +1,35 @@ | |||
:: Fichier bat d'insertion des données du RPG sur le schéma CUDL | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ajoute ici les variables USER, MDP, instance et chemin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Juste pour être sûr, MDP ce n'est pas pour y stocket le mot de passe en dur et en clair dans le code ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nous c'est pour demander ces paramètres à l'utilisateur lors du lancement du script.
integration/RPG/import_fichier.bat
Outdated
CD C:/ora12c/R1/BIN | ||
|
||
:: 6. Lancement des traitements sous sqlplus (clé primaire, indexes...) | ||
sqlplus.exe USER/MDP@INSTANCE @C:\Users\rjault\Documents\06_TEST_IRIS_BAT\iris_temp.sql |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Remplace "iris_temp.sql" par "traitement_rpg.sql" ;
- Attention aux chemins ! Utilise des variables qui demandent à l'utilisateur de les saisir, c'est plus sécurisé.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c'est corrigé
integration/RPG/traitement_rpg.sql
Outdated
-- 1.1.1. suppression de la colonne OGR_FID | ||
ALTER TABLE G_ADT_AGRI.RPG_2019_MEL DROP COLUMN OGR_FID CASCADE CONSTRAINTS; | ||
|
||
-- 1.1.2. Ajout de la colonne OBJECTID | ||
ALTER TABLE G_ADT_AGRI.RPG_2019_MEL | ||
ADD (OBJECTID NUMBER(38,0)); | ||
|
||
-- 1.1.3. Ajout de la séquence | ||
CREATE SEQUENCE SEQ_RPG_2019_MEL INCREMENT BY 1 START WITH 1 NOCACHE; | ||
|
||
-- 1.1.4. Ajout du trigger | ||
CREATE OR REPLACE TRIGGER BEF_RPG_2019_MEL | ||
BEFORE INSERT ON TABLE_NAME FOR EACH ROW | ||
BEGIN | ||
:new.OBJECTID := SEQ_RPG_2019_MEL.nextval; | ||
END; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Si la position de la PK te préoccupe, au lieu de supprimer le champ ogr_fid, renomme le en objectid, supprime les données de ce champ, puis créée une séquence et un trigger d'auto-incrémentation (je crois que l'incrémentation des données existantes se fera (à vérifier quand même)).
- ligne 21 remplace TABLE_NAME par RPG_2019_MEL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C'est corrigé merci
integration/RPG/traitement_rpg.sql
Outdated
UPDATE G_ADT_AGRI.RPG_2019_MEL | ||
SET objectid = SEQ_RPG_2019_MEL.nextval; | ||
|
||
-- 1.1.6. Ajout de la contrainte d'unicité clé primaire |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mets plutôt "Ajout de la contrainte de clé primaire", sinon ton commentaire introduit une confusion pour le lecteur
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C'est corrigé.
integration/RPG/traitement_rpg.sql
Outdated
|
||
-- 1.2.2 Ajout des métadonnées spatiales | ||
INSERT INTO USER_SDO_GEOM_METADATA (TABLE_NAME, COLUMN_NAME, DIMINFO, SRID) | ||
VALUES ('RPG_2019_MEL', 'GEOM', SDO_DIM_ARRAY(SDO_DIM_ELEMENT('X', 594000, 964000, 0.005),SDO_DIM_ELEMENT('Y', 6987000, 7165000, 0.005)), 2154); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sauts de ligne à rajouter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c'est corrigé
integration/RPG/traitement_rpg.sql
Outdated
|
||
-- 3.1.5. Mise à jour de la colonne OBJECTID | ||
UPDATE G_ADT_AGRI.RPG_PACAGE_FORMEJURIDIQUE_2019_MEL | ||
SET objectid = RPG_PACAGE_FORMEJURIDIQUE_2019_MEL.nextval; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rajoute le préfixe SEQ_
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C'est corrigé
integration/RPG/traitement_rpg.sql
Outdated
UPDATE G_ADT_AGRI.RPG_ILOTS_DESCRIPTION_2019_MEL | ||
SET objectid = SEQ_RPG_ILOTS_DESCRIPTION_2019_MEL.nextval; | ||
|
||
-- 4.1.6. Ajout de la contrainte d'unicité clé primaire |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mets plutôt "Ajout de la contrainte de clé primaire", sinon ton commentaire introduit une confusion pour le lecteur
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C'est corrigé
integration/RPG/traitement_rpg.sql
Outdated
-- 5.1.1. suppression de la colonne OGR_FID | ||
ALTER TABLE G_ADT_AGRI.RPG_AIDES_2ND_PILIER_2019_MEL DROP COLUMN OGR_FID CASCADE CONSTRAINTS; | ||
|
||
-- 5.1.2. Ajout de la colonne OBJECTID | ||
ALTER TABLE G_ADT_AGRI.RPG_AIDES_2ND_PILIER_2019_MEL | ||
ADD (OBJECTID NUMBER(38,0)); | ||
|
||
-- 5.1.3. Ajout de la séquence | ||
CREATE SEQUENCE SEQ_RPG_AIDES_2ND_PILIER_2019_MEL INCREMENT BY 1 START WITH 1 NOCACHE; | ||
|
||
-- 5.1.4. Ajout du trigger | ||
CREATE OR REPLACE TRIGGER BEF_RPG_AIDES_2ND_PILIER_2019_MEL | ||
BEFORE INSERT ON TABLE_NAME FOR EACH ROW | ||
BEGIN | ||
:new.OBJECTID := SEQ_RPG_AIDES_2ND_PILIER_2019_MEL.nextval; | ||
END; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Même commentaire que pour RPG_2019_MEL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C'est corrigé
integration/RPG/traitement_rpg.sql
Outdated
UPDATE G_ADT_AGRI.RPG_AIDES_2ND_PILIER_2019_MEL | ||
SET objectid = SEQ_RPG_AIDES_2ND_PILIER_2019_MEL.nextval; | ||
|
||
-- 5.1.6. Ajout de la contrainte d'unicité clé primaire |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mets plutôt "Ajout de la contrainte de clé primaire", sinon ton commentaire introduit une confusion pour le lecteur
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C'est corrigé
integration/RPG/traitement_rpg.sql
Outdated
-- 6.1. creation de la clé primaire | ||
|
||
-- 6.1.1. suppression de la colonne OGR_FID | ||
ALTER TABLE G_ADT_AGRI.RPG_AIDES_1ER_PILIER_2019_MEL DROP COLUMN OGR_FID CASCADE CONSTRAINTS; | ||
|
||
-- 6.1.2. Ajout de la colonne OBJECTID | ||
ALTER TABLE G_ADT_AGRI.RPG_AIDES_1ER_PILIER_2019_MEL | ||
ADD (OBJECTID NUMBER(38,0)); | ||
|
||
-- 6.1.3. Ajout de la séquence | ||
CREATE SEQUENCE SEQ_RPG_AIDES_1ER_PILIER_2019_MEL INCREMENT BY 1 START WITH 1 NOCACHE; | ||
|
||
-- 6.1.4. Ajout du trigger | ||
CREATE OR REPLACE TRIGGER BEF_RPG_AIDES_1ER_PILIER_2019_MEL | ||
BEFORE INSERT ON TABLE_NAME FOR EACH ROW | ||
BEGIN | ||
:new.OBJECTID := SEQ_RPG_AIDES_1ER_PILIER_2019_MEL.nextval; | ||
END; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Même commentaire que pour RPG_2019_MEL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C'est corrigé
Correction suite à la relecture.
Mise à jour du fichier traitement
mise à jour du fichier import_fichier.bat
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correction blocs declare
integration/RPG/traitement_rpg.sql
Outdated
SET SERVEROUTPUT ON | ||
DECLARE | ||
v_nom VARCHAR2(200); | ||
BEGIN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Supprime ce "SERVEROUTPUT ON", change le nom de ta variable et met la dans dans ton premier declare ligne 5.
- Pareil change aussi le nom de ta variable ligne pour qu'on sache que tu l'utilises pour la table RPG_2019_MEL.
- Supprime ce "BEGIN"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ca ne fonctionne pas, je suis revenu à un état précédent de la requete
integration/RPG/traitement_rpg.sql
Outdated
SET SERVEROUTPUT ON | ||
DECLARE | ||
v_nom VARCHAR2(200); | ||
BEGIN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Supprime ce "SERVEROUTPUT ON", change le nom de ta variable et met la dans dans ton premier declare ligne 5.
- Supprime ce "BEGIN"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ca ne fonctionne pas, je suis revenu à un état précédent de la requete
integration/RPG/traitement_rpg.sql
Outdated
SET SERVEROUTPUT ON | ||
DECLARE | ||
v_nom VARCHAR2(200); | ||
BEGIN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Supprime ce "SERVEROUTPUT ON", change le nom de ta variable et met la dans dans ton premier declare ligne 5.
- Supprime ce "BEGIN"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ca ne fonctionne pas, je suis revenu à un état précédent de la requete
integration/RPG/traitement_rpg.sql
Outdated
SET SERVEROUTPUT ON | ||
DECLARE | ||
v_nom VARCHAR2(200); | ||
BEGIN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Supprime ce "SERVEROUTPUT ON", change le nom de ta variable et met la dans dans ton premier declare ligne 5.
- Supprime ce "BEGIN"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ca ne fonctionne pas, je suis revenu à un état précédent de la requete
integration/RPG/traitement_rpg.sql
Outdated
SET SERVEROUTPUT ON | ||
DECLARE | ||
v_nom VARCHAR2(200); | ||
BEGIN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Supprime ce "SERVEROUTPUT ON", change le nom de ta variable et met la dans dans ton premier declare ligne 5.
- Supprime ce "BEGIN"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ca ne fonctionne pas, je suis revenu à un état précédent de la requete
version finale du code sans point de sauvegarde.
correciton coquille
correction; suppression du UPDATE USER_SDO_GEOM_METADATA ligne 71
Objectif: Intégration des données de RPG sur le schéma CUDL
Actions à mener
Les requêtes d'insertion en base sont finalisées. Cependant j'ai un petit problème pour ajouter dans le script les points de sauvegarde. Cela doit venir du fait qu'il y a plusieurs blocs de PLSQL dans les requêtes. Avez-vous une petite idée de la syntaxe à utiliser pour les rajouter?
Les données sont sur l'instance cudlt pour l'instant. Lors du passage en prod pouvez vous juste lors de la relecture vérifier les TABLESPACE ainsi que le work_tablespace ligne 82?
-- Pour des raisons de syntaxes PLSQL, j'ai du retirer les points de sauvegardes. Cependant en test, les requêtes fonctionnent.--