Posted By

wh0emPah on 04/01/10


Tagged


Versions (?)

jljl


 / Published in: PL/SQL
 

  1. CREATE OR REPLACE PROCEDURE P3_8_OVERZICHT_KLANTEN_ORDERS AS
  2. CURSOR C_CUSTOMER IS
  3. SELECT ID, NAME
  4. FROM S_CUSTOMER
  5. ORDER BY ID;
  6.  
  7. CURSOR C_ORDERS(P_CUSTOMER IN S_CUSTOMER.ID%TYPE) IS
  8. SELECT ID, DATE_ORDERED, TOTAL
  9. FROM S_ORD
  10. WHERE CUSTOMER_ID = P_CUSTOMER
  11. ORDER BY ID;
  12. FOR R_CUST IN C_CUSTOMER LOOP
  13. DBMS_OUTPUT.PUT_LINE(' ');
  14. DBMS_OUTPUT.PUT_LINE(R_CUST.ID || ' ' || R_CUST.NAME);
  15. DBMS_OUTPUT.PUT_LINE('------------------------------');
  16. FOR R_ORD IN C_ORDERS(R_CUST.ID) LOOP
  17. DBMS_OUTPUT.PUT_LINE(R_ORD.ID || ' ' || R_ORD.DATE_ORDERED || ' ' || R_ORD.TOTAL);
  18. END P3_8_OVERZICHT_KLANTEN_ORDERS;

Report this snippet  

You need to login to post a comment.