|Home • Trainings • Quiz • Tips • Tutorials • Functional • Cert Q's • Interview Q's • Jobs • Testimonials • Advertise • Contact Us|
Difference between NULL and SPACE
by Raghavender Vedakattu
Consider a database table, “ZEMPLOYEE”, with the following fields:MANDT EMPNO EMPNAME EMPSAL.
Lets insert some records into this table.
Now let’s add a new field
“DEPT (CHAR10)” to this table (without checking the “key” and “initial
values” check boxes), and then activate the table. Since the newly added field
is not a part of primary key, there would be no problems in activating the
following two SELECT queries are executed, no records are retrieved even though
many records satisfying the WHERE condition (General assumption what we make).
This is the
Here is the solution:
we insert a new field to an existing table, NULL values are automatically
inserted into the new field by the system for all existing records. However NULL
and SPACE are not the same.
expression SQL condition is either "true, false, or unknown". The
expression is UNKNOWN if one of the columns involved in the database contains a
NULL value and such records could be retrieved by using “IS NULL” instead of
Please note that the NULL value is inserted only for the
existing records, by the time the new field is being inserted. For all new
records, SPACE or the initial (default) value is inserted.
If the new field is inserted by checking the checkbox “initial values”, then the initial values (SPACE in case of characters) are automatically inserted and not the NULL values.
Please send us your feedback/suggestions at webmaster@SAPTechnical.COM
©2006-2007 SAPTechnical.COM. All rights reserved.
product names are trademarks of their respective companies. SAPTechnical.COM
is in no way affiliated with SAP AG.
Graphic Design by Round the Bend Wizards