From 472e75fb6a3100bb4c3958d58646511e60576430 Mon Sep 17 00:00:00 2001 From: pascal Date: Mon, 1 Feb 2021 13:52:07 +0100 Subject: [PATCH] ok --- COURS/C-exo6.sql | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 COURS/C-exo6.sql diff --git a/COURS/C-exo6.sql b/COURS/C-exo6.sql new file mode 100644 index 0000000..9a25c55 --- /dev/null +++ b/COURS/C-exo6.sql @@ -0,0 +1,47 @@ +ET echo OFF +SET verify OFF +SET feed OFF + +DROP TABLE tligne; +CREATE TABLE Tligne(ligne VARCHAR2(200)); + +variable Vref CHAR(5) +PROMPT Donner un numero de fournisseur: +ACCEPT Vref + +declare +DnoProduit char(5); + +BEGIN + +SELECT noProduit INTO DnoProduit +FROM tProduitFourn +WHERE ref = '&Vref'; + + + +INSERT INTO Tligne +VALUES('Le fournisseur'||' &Vref '||' a un produit :'|| DnoProduit); + + +exception +when no_data_found then +INSERT INTO Tligne +VALUES('Le fournisseur n a pas de produit'); + +WHEN too_many_rows then +INSERT INTO Tligne +VALUES('Le fournisseur a plusieurs produits'); +END; +. +/ + + + + + +SELECT * FROM Tligne; + +SET echo ON +SET verify ON +SET feed ON