How Defaults Affect NULL Values

If you specify NOT NULL when you create a column and do not create a default for it, SAP ASE produces an error message whenever a user inserts a row without making an entry in that column.

When you drop a default for a NULL column, SAP ASE inserts NULL in that position each time you add rows without entering any value for that column. When you drop a default for a NOT NULL column, you get an error message when rows are added, without a value entered for that column.

This table illustrates the relationship between the existence of a default and the definition of a column as NULL or NOT NULL.

Column Definition

User Entry

Result

Null and default defined

No value

NULL value

Default used

NULL used

Null defined, no default defined

No value

NULL value

NULL used

NULL used

Not null, default defined

No value

NULL value

Default used

Error

Not null, no default defined

No value

NULL value

Error

Error