Commit fe278cce authored by Evenson Jeunesse's avatar Evenson Jeunesse
Browse files

Update INSERT_RO_2.sql

parent e6f8bfbb
DECLARE
RefClasse1 REF TClasse;
RefClasse2 REF TClasse;
RefEspece1 REF TEspece;
RefEspece2 REF TEspece;
......@@ -17,22 +16,29 @@ RefTraitement3 REF TTraitement;
BEGIN
INSERT INTO Classe (nom) VALUES ('mammifere');
INSERT INTO Classe (nom) VALUES ('reptile');
INSERT INTO Classe VALUES ('mammifère');
INSERT INTO Classe VALUES ('reptile');
--init RefClasse1
SELECT REF(C) INTO RefClasse1 FROM Classe C WHERE nom='mammifere';
SELECT REF(C) INTO RefClasse2 FROM Classe C WHERE nom='reptile';
SELECT REF(C) INTO RefClasse1 FROM Classe C WHERE nom='mammifère';
INSERT INTO Espece VALUES ('chien', RefClasse1);
INSERT INTO Espece VALUES ('chat', RefClasse1);
--init RefEspece1 & RefEspece2
SELECT REF(E) INTO RefEspece1 FROM Espece E WHERE nom='chien';
SELECT REF(E) INTO RefEspece2 FROM Espece E WHERE nom='chat';
INSERT INTO Medicament VALUES ('BHRG', 'anti puce', (ListRefEspece(TRefEspece(RefEspece1), TRefEspece(RefEspece2))));
INSERT INTO Medicament VALUES ('KHFG', 'calmant', (ListRefEspece(TRefEspece(RefEspece1))));
INSERT INTO Medicament VALUES ('BHRG', 'anti puce',
ListRefEspece(
TRefEspece(RefEspece1),
TRefEspece(RefEspece2)
)
);
INSERT INTO Medicament VALUES ('KHFG', 'calmant', (RefEspece1));
--init RefMedicament1 & RefMedicament2
SELECT REF(M) INTO RefMedicament1 FROM Medicament M WHERE nomMolecule='BHRG';
SELECT REF(M) INTO RefMedicament2 FROM Medicament M WHERE nomMolecule='KHFG';
......@@ -45,17 +51,20 @@ INSERT INTO Taitement VALUES
TPrescription(RefMedicament2, 1)
)
);
INSERT INTO Taitement VALUES
(
2, 'traitement calmant', TO_DATE('2019-06-10','YYYY-MM-DD'),3,
ListPrescription(TPrescription(RefMedicament2, 1 ))
);
INSERT INTO Taitement VALUES
(
3, 'traitement anti puce', TO_DATE('2019-06-10','YYYY-MM-DD'),4,
ListPrescription(TPrescription(RefMedicament1, 2 ))
);
--Init RefTraitement1 & RefTraitement2 & RefTraitement3
SELECT REF(T) INTO RefTraitement1 FROM Traitement T WHERE id=1;
SELECT REF(T) INTO RefTraitement2 FROM Traitement T WHERE id=2;
......@@ -65,25 +74,33 @@ SELECT REF(T) INTO RefTraitement3 FROM Traitement T WHERE id=3;
INSERT INTO Clients VALUES
(
1, 0789653214, 'bond', 'james', TO_DATE('1985-01-12', 'YYYY-MM-DD'), '150 avenue de Paris',
LAniamux(TAnimaux(1,'lechien', 15, 30, TO_DATE('1999-01-12', 'YYYY-MM-DD'), RefEspece1,ListRefTraitement(TRefTraitement(RefTraitement1), TRefTraitement(RefTraitement2))),
TAnimaux(2,'lechat', 12, 10, TO_DATE('1999-01-12', 'YYYY-MM-DD'), RefEspece2, ListRefTraitement(TRefTraitement(RefTraitement3))))
( TAnimal(
1,'lechien', 15, 30, TO_DATE('1999-01-12', 'YYYY-MM-DD'), RefEspece1,
ListRefTraitement(TRefTraitement(RefTraitement1), TRefTraitement(RefTraitement2))
),
TAnimal(
2,'lechat', 12, 10, TO_DATE('1999-01-12', 'YYYY-MM-DD'), RefEspece2,
ListRefTraitement(TRefTraitement(RefTraitement3))
)
)
);
INSERT INTO Veterinaires VALUES
(1, '0616814835', 'Martin', 'John', '1970-01-20', '10 rue Saint Anne 75009 Paris', RefClasse1,
ListRefTraitement(TRefTraitement(RefTraitement1), TRefTraitement(RefTraitement2))
);
INSERT INTO Veterinaires VALUES
(1, '0616814835', 'Anna', 'Alston', '1980-01-20', '10 rue De gaule 75009 Paris', RefClasse1,
ListRefTraitement(TRefTraitement(RefTraitement3))
);
INSERT INTO Assistants VALUES
(3, '0616445424', 'Dubois', 'Thomas', '1980-08-10', '15 faubourg Saint Martin 75010 Paris', RefClasse1);
INSERT INTO Assistants VALUES
(3, '0616445424', 'Dubois', 'Thomas', '1980-08-10', '15 faubourg Saint Martin 75010 Paris', RefClasse1),
(4, '0854345689', 'Picard', 'Jacques', '1920-12-12', '19 rue Saint Gervais 60700 Pontpoint', RefClasse1);
END;
END;
/
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment