Maj du git depuis la derniere fois
This commit is contained in:
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