Maj du git depuis la derniere fois
This commit is contained in:
@@ -36,3 +36,12 @@ SELECT id, nom_produit, prix_unitaire INTO v_produit FROM Produit WHERE id=1;
|
||||
DBMS_OUTPUT.PUT_LINE(v_produit.id || ' ' || v_produit.nom || ' ' || v_produit.prix_unitaire);
|
||||
END;
|
||||
/
|
||||
|
||||
--4
|
||||
|
||||
DECLARE
|
||||
CURSOR c.client_commande is SELECT c.id,c.prenom,c.nom,c.email,c.ville,co.date_achat,co.id_produit,lc.quantite FROM Client c JOIN Commande co ON c.id=co.client_id JOIN ligne_commande WHERE co.date_achat=;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
14
TP_BD/fichiereponsetp2.sql
Normal file
14
TP_BD/fichiereponsetp2.sql
Normal file
@@ -0,0 +1,14 @@
|
||||
--1
|
||||
CREATE SEQUENCE seq_tp
|
||||
INCREMENT BY 1
|
||||
START WITH 121;
|
||||
BEGIN
|
||||
|
||||
--2
|
||||
|
||||
CREATE PROCEDURE sp_insert_ligne_commande(p_commande_id INT, p_produit_id INT,p_quantit number)
|
||||
is v_prix_total NUMBER
|
||||
BEGIN
|
||||
SELECT p.prix_unitaire*lc.p_quantite into v_prix_total FROM Produit p, Ligne_commande lc WHERE p.id=p_produit_id
|
||||
INSERT INTO Ligne_commande values (seq_t.NEXT, p_commande_id,
|
||||
p_produit_id, p_quantite,v_prix_total)
|
||||
Reference in New Issue
Block a user