Posted By

wh0emPah on 04/02/10


Tagged


Versions (?)

zerfz


 / Published in: PL/SQL
 

  1. PROCEDURE P4_VOEG_KLANT_TOE(
  2. p_id IN S_CUSTOMER.ID%TYPE,
  3. p_name IN S_CUSTOMER.NAME%TYPE,
  4. p_phone IN S_CUSTOMER.PHONE%TYPE,
  5. p_address IN S_CUSTOMER.ADDRESS%TYPE,
  6. p_city IN S_CUSTOMER.CITY%TYPE,
  7. p_state IN S_CUSTOMER.STATE%TYPE,
  8. p_country IN S_CUSTOMER.COUNTRY%TYPE,
  9. p_zipcode IN S_CUSTOMER.ZIP_CODE%TYPE
  10. )
  11. e_char_to_number EXCEPTION;
  12. PRAGMA EXCEPTION_init(e_char_to_number, -6502);
  13. e_not_null EXCEPTION;
  14. PRAGMA EXCEPTION_init(e_not_null, -1400);
  15. INSERT INTO S_CUSTOMER(ID, NAME, PHONE, address, city, state, country,ZIP_CODE)
  16. VALUES (p_id,p_name,P_PHONE,P_ADDRESS,P_CITY,P_STATE,P_COUNTRY,P_ZIPCODE);
  17. WHEN E_CHAR_TO_NUMBER THEN
  18. DBMS_OUTPUT.PUT_LINE ('Klant ID moet een getal zijn!');
  19. DBMS_OUTPUT.PUT_LINE ('Er bestaat al een klatn met dit ID');
  20. WHEN E_NOT_NULL THEN
  21. DBMS_OUTPUT.PUT_LINE ('Er zijn geen null waardes toegelaten');
  22. raise_application_error( -20000, 'Onbekende fout opgetreden');
  23.  
  24. END P4_VOEG_KLANT_TOE;

Report this snippet  

You need to login to post a comment.