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

Integration rpg #110

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

Conversation

romain-jault
Copy link
Contributor

@romain-jault romain-jault commented Oct 30, 2020

Objectif: Intégration des données de RPG sur le schéma CUDL

Actions à mener

  • un reviewer a été ajouté
  • le code et les noms d'objets suivent la syntaxe

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.--

fichier d'import des données du RPG
traitement des données.
@romain-jault romain-jault added the Non intégrable En cours de travail, ne pas intégrer label Oct 30, 2020
Mise à jour du fichier pour ajouter les commentaires des tables.
Copy link
Contributor

@BaptisteJacq BaptisteJacq left a 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

Copy link
Contributor

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

Copy link
Contributor

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 ?

Copy link
Contributor Author

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.

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
Copy link
Contributor

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é.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

c'est corrigé

Comment on lines 9 to 24
-- 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;
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C'est corrigé merci

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
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C'est corrigé.


-- 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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sauts de ligne à rajouter

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

c'est corrigé


-- 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;
Copy link
Contributor

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_

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C'est corrigé

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
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C'est corrigé

Comment on lines 157 to 172
-- 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;
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C'est corrigé

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
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C'est corrigé

Comment on lines 188 to 205
-- 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;
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C'est corrigé

Mise à jour du fichier traitement
mise à jour du fichier import_fichier.bat
Copy link
Contributor

@BaptisteJacq BaptisteJacq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correction blocs declare

Comment on lines 117 to 120
SET SERVEROUTPUT ON
DECLARE
v_nom VARCHAR2(200);
BEGIN
Copy link
Contributor

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"

Copy link
Contributor Author

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

Comment on lines 190 to 193
SET SERVEROUTPUT ON
DECLARE
v_nom VARCHAR2(200);
BEGIN
Copy link
Contributor

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"

Copy link
Contributor Author

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

Comment on lines 246 to 249
SET SERVEROUTPUT ON
DECLARE
v_nom VARCHAR2(200);
BEGIN
Copy link
Contributor

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"

Copy link
Contributor Author

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

Comment on lines 304 to 307
SET SERVEROUTPUT ON
DECLARE
v_nom VARCHAR2(200);
BEGIN
Copy link
Contributor

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"

Copy link
Contributor Author

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

Comment on lines 367 to 370
SET SERVEROUTPUT ON
DECLARE
v_nom VARCHAR2(200);
BEGIN
Copy link
Contributor

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"

Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Non intégrable En cours de travail, ne pas intégrer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants