Posted By

wh0emPah on 03/28/10


Tagged


Versions (?)

BLABLABLA


 / Published in: PL/SQL
 

  1. CREATE OR REPLACE PROCEDURE P1_2_VOEG_ORDER_TOE
  2. (
  3. P_ID IN S_ORD.ID%TYPE
  4. , P_CUSTOMERID IN S_ORD.CUSTOMER_ID%TYPE
  5. , P_SALES_REP_ID IN S_ORD.SALES_REP_ID%TYPE
  6. , P_DATE_ORDERED IN S_ORD.DATE_ORDERED%TYPE
  7. , P_PAYMENT_TYPE IN S_ORD.PAYMENT_TYPE%TYPE
  8. ) AS
  9. v_jobtitle S_EMP.TITLE%TYPE;
  10. SELECT UPPER(TITLE)
  11. INTO v_jobtitle
  12. FROM S_EMP
  13. WHERE ID = p_sales_rep_id;
  14.  
  15. IF V_JOBTITLE = 'SALES REPRESENTATIVE' THEN
  16. INSERT INTO S_ORD(id, customer_id, SALES_REP_ID, DATE_ORDERED, PAYMENT_TYPE)
  17. VALUES(p_id, p_customerid, p_sales_rep_id, p_date_ordered, p_payment_type);
  18. DBMS_OUTPUT.PUT_LINE('Order toegevoegd');
  19. DBMS_OUTPUT.PUT_LINE('Order NIET toegevoegd');
  20.  
  21. END P1_2_VOEG_ORDER_TOE;

Report this snippet  

You need to login to post a comment.