Posted By

wh0emPah on 03/31/10


Tagged


Versions (?)

aaa


 / Published in: PL/SQL
 

  1. CREATE OR REPLACE PROCEDURE P1_8_MINSTE_ORDERS AS
  2. V_AANTAL_ORDERS NUMBER;
  3. V_SALES_REP_ID S_EMP.ID%TYPE;
  4. V_VOORNAAM S_EMP.FIRST_NAME%TYPE;
  5. V_NAAM S_EMP.LAST_NAME%TYPE;
  6. SELECT SALES_REP_ID, COUNT(*)
  7. INTO V_SALES_REP_ID, V_AANTAL_ORDERS
  8. FROM S_ORD
  9. GROUP BY SALES_REP_ID
  10. FROM S_ORD
  11. GROUP BY SALES_REP_ID);
  12.  
  13. SELECT FIRST_NAME, LAST_NAME
  14. INTO V_VOORNAAM, V_NAAM
  15. FROM S_EMP
  16. WHERE ID = V_SALES_REP_ID;
  17.  
  18. DBMS_OUTPUT.PUT_LINE(V_VOORNAAM || ' ' || V_NAAM || ' Met ' || V_AANTAL_ORDERS || ' Orders');
  19.  
  20. END P1_8_MINSTE_ORDERS;

Report this snippet  

You need to login to post a comment.