Validating null value in plsql online dating norfolk va
As Fabricio Araujo hinted, NULL is not really a value like the number 4 or string 'bacon strips'.
In fact, NULL is untyped in the SQL language, which is why you cannot validly use it in an equality comparison.
NVL takes two arguments, the first being a variable and the second being a value (constant or computed).
NVL looks at its first argument and, if it finds that the first argument is NULL, returns the second argument.
You need the special @Jack - Actually, taking a cursory look at this posting of the SQL-92 standard, section 4.1 states: "A null value is an implementation-dependent special value that is distinct from all non-null values of the associated data type.
There is effectively only one null value and that value is a member of every SQL data type." I would say "untyped" is a good summary of "is a member of every data type". You've casted the original, "untyped" NULL to a "typed" NULL.
In the above example, col1 variable is declared as VARCHAR2 and the empty string is treated as NULL.TO_CHAR(LENGTH(col1))); 6 IF (col1 IS NULL) THEN 7 dbms_output.put_line('Treated as NULL'); 8 END IF; 8 IF (col1 = '') THEN 10 dbms_output.put_line('Treated as EMPTY STRING'); 11 END IF; 12* END; 13 / Length: Treated as NULL PL/SQL procedure successfully completed.