Posted By

wh0emPah on 04/01/10


Tagged


Versions (?)

jljl


 / Published in: PL/SQL
 

  1. CREATE OR REPLACE PROCEDURE P3_S7_OVERZICHT_PRODUCTEN_WH AS
  2. CURSOR C_WAREHOUSES IS
  3. SELECT ID, CITY
  4. FROM S_WAREHOUSE;
  5.  
  6. CURSOR C_PROD_WH (P_WHID IN S_WAREHOUSE.ID%TYPE) IS
  7. SELECT PRODUCT_ID, (SELECT NAME
  8. FROM S_PRODUCT
  9. WHERE ID = PRODUCT_ID) NAME
  10. FROM S_INVENTORY
  11. WHERE WAREHOUSE_ID = P_WHID
  12. ORDER BY PRODUCT_ID;
  13.  
  14. FOR R_WH IN C_WAREHOUSES LOOP
  15. DBMS_OUTPUT.PUT_LINE(' ');
  16. DBMS_OUTPUT.PUT_LINE(R_WH.ID || ' ' || R_WH.CITY);
  17. DBMS_OUTPUT.PUT_LINE('---------------------------');
  18. FOR R_PROD IN C_PROD_WH(R_WH.ID) LOOP
  19. DBMS_OUTPUT.PUT_LINE(R_PROD.PRODUCT_ID || ' ' || R_PROD.NAME);
  20. END P3_S7_OVERZICHT_PRODUCTEN_WH;

Report this snippet  

You need to login to post a comment.