code_junkie

Better way to structure a PL/SQL IF THEN statement

Nov 13th, 2011
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. IF(p_c_courtesies_cd is not null
  2. OR p_c_language_cd is not null
  3. OR v_c_name is not null
  4. OR v_c_firstname is not null
  5. OR v_c_function is not null
  6. OR p_c_phone is not null
  7. OR p_c_mobile is not null
  8. OR p_c_fax is not null
  9. OR v_c_email is not null
  10. ) THEN
  11. -- Do something
  12. END IF;
  13.  
  14. If coalesce( expr1, expr2, ... expr_n ) is not null then do something end if;
  15.  
  16. IF p_c_courtesies_cd
  17. || p_c_language_cd
  18. || v_c_name
  19. || v_c_firstname
  20. || v_c_function
  21. || p_c_phone
  22. || p_c_mobile p_c_fax
  23. || v_c_email is not null
  24. THEN
  25. -- Do something
  26. END IF;
Add Comment
Please, Sign In to add comment