Quick Search:
 
 The Oracle NULL Value      [Return To Index] Jump to:  

Term: NULL

Definition:
NULL values represent missing or unknown data. NULL values are used as placeholders or as the default entry in columns to indicate that no actual data is present. The NULL is untyped in SQL, meaning that it is not an integer, a character, or any other specific data type.

Note that NULL is not the same as an empty data string or the numerical value '0'. While NULL indicates the absence of a value, the empty string and numerical zero both represent actual values.

While a NULL value can be assigned, it can not be equated with anything, including itself.

Because NULL does not represent or equate to a data type, you cannot test for NULL values with any comparison operators, such as =, <, or <>.

The IS NULL and IS NOT NULL operators are used to test for NULL values.

Example Syntax:

Testing a value for NULL:

UPDATE test
SET test1 = '2'
WHERE test2 IS NULL;


Updating a column so that it does not contain a value:

UPDATE test
SET test1 = NULL
WHERE ROWNUM = 1;


Using NULL as part of the WHERE clause criteria in a DELETE statement:

DELETE FROM test
WHERE first_name IS NULL;



Related Links:

Related Code Snippets:
  • NVL: Replace NULL values - The function NVL replaces null values with a stated value. In this exam...
  • IGNORE NULLS - Disregards the presence of NULL chars in the specified column.
  • IS NOT NULL - In PLSQL to check if a value is not null, you must use the "IS NOT NULL" syntax.
 
   Home |    Search |    Code Library |    Sponsors |    Privacy |    Terms of Use |    Contact Us © 2003 - 2024 psoug.org