Oracle NANVL Function


/ Published in: SQL
Save to your folder(s)

A few examples of the NANVL function.


Copy this code and paste it in your HTML
  1. CREATE TABLE nanvl_test (
  2. num_val NUMBER(10,3),
  3. f_val FLOAT(3),
  4. bf_val BINARY_FLOAT,
  5. bd_val BINARY_DOUBLE);
  6.  
  7. INSERT INTO nanvl_test (num_val, f_val, bf_val, bd_val)
  8. VALUES (123.456, 234.567, 987.654, 135.789);
  9.  
  10.  
  11. INSERT INTO nanvl_test (num_val, f_val, bf_val, bd_val)
  12. VALUES (0, 0, 'NaN', 'NaN');
  13.  
  14. SELECT num_val, f_val, bf_val, bd_val,
  15. NANVL(num_val, 9999) AS nan_num,
  16. NANVL(f_val, 9999) AS nan_f,
  17. NANVL(bf_val, 9999) AS nan_bf,
  18. NANVL(bd_val, 9999) AS nan_bd
  19. FROM nanvl_test;

URL: http://www.databasestar.com/oracle-nanvl

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.