Advertisement
Benlahbib_Abdessamad

Untitled

May 25th, 2015
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.89 KB | None | 0 0
  1. TRUNCATE TABLE budget_seuil;
  2.  
  3. Accept x NUMBER Prompt " Entrez le seuil : "
  4. DECLARE
  5. Cursor budget_eSeuil(s NUMBER) IS (SELECT Num_operation,Date_operation,montant FROM budget WHERE montant > s) ;
  6. ligne budget_eSeuil % Rowtype;
  7. seuil NUMBER;
  8. BEGIN
  9. seuil:=&x;
  10. OPEN budget_eSeuil(seuil);
  11. loop
  12. Fetch budget_eSeuil INTO ligne;
  13. exit WHEN budget_eSeuil%NotFound ;
  14. INSERT INTO BUDGET_SEUIL VALUES (ligne.num_operation,ligne.date_operation,ligne.montant) ;
  15. END loop;
  16. close budget_eSeuil;
  17.  
  18. END;
  19. /
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26. ------------------------------------------------------------------------------>
  27.  
  28.  
  29.  
  30. TRUNCATE TABLE budget_seuil;
  31. Accept x NUMBER Prompt " Entrez le seuil : "
  32. DECLARE
  33. BEGIN
  34. FOR ligne IN (SELECT Num_operation,Date_operation,montant FROM budget WHERE montant > &x)
  35. loop
  36. INSERT INTO BUDGET_SEUIL VALUES (ligne.num_operation,ligne.date_operation,ligne.montant) ;
  37. END loop;
  38. END;
  39. /
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement