Set Null, Set("Null")
Judicious absence is a weapon.
Charles Reade
This command determines whether or not fields added or modified with CREATE TABLE and ALTER TABLE default to accepting nulls, and whether unspecified fields in INSERT-SQL are filled with null or empty values. The function returns the current setting.
Usage |
SET NULL ON | OFF cOnOrOff = SET( "NULL" ) |
Example |
SET NULL OFF CREATE TABLE Test1 (cfld C(3), nfld N(4) NULL) * cfld doesn't accept nulls, but nfld does SET NULL ON CREATE TABLE Test2 (cfld C(3) NOT NULL, nfld N(4)) * same as above - no nulls for cfld, but nfld accepts them * now let's put some data in * NULL is still ON INSERT INTO Test1 (cfld) VALUES ("abc") SELECT Test1 ? ISNULL(nfld) && returns .t. ? ISBLANK(nfld) && returns .f. SET NULL OFF INSERT INTO Test1 (cfld) VALUES ("def") ? ISNULL(nfld) && returns .f. ? ISBLANK(nfld) && returns .t. |
See Also |
Alter Table, Blank, Create Table, Insert-SQL, IsBlank(), IsNull(), Set |