Show TOC Start of Content Area

Background documentation Initial Values  Locate the document in its SAP Library structure

If the value of a field in a data record is undefined or unknown, it is called a null value. Null values arise, for example, when you insert new fields into existing tables.

If a new field is inserted in a table that already exists on the database, this operation is executed on the database using the DDL statement ALTER TABLE tabellenname ADD FIELD feldname... . These existing records have a NULL value in the new field..

If a field with NULL values is selected, some of the entries satisfying the selection condition might not be found. This is because NULL values only satisfy the selection condition WHERE FIELD IS NULL.

Example

Field Field1 is inserted in table TAB. If this table is accessed using the SELECT... FROM TAB WHERE Field1 <> 5... statement, records with NULL values are not found in Field1, even though they logically correspond to the WHERE condition of the SELECT statement.

The case described in the example can be avoided by assigning the Not Null attribute to the field. If you choose the Not Null attribute for a data type, you should also enter a default value.

The following proposals for default values are offered in the Java Dictionary:

 

Data type:

Proposal for default value:

Notes:

string

<space>

You can overwrite the proposal.

Note

The value should be entered without the angle brackets (<>).

binary

-

The data type binary has no proposal. You cannot set Not Null in this case.

short

0

You can overwrite the proposals for the default value with values of your choice.

integer

0

long

0

float

0

double

0

decimal

0

date

-

The data types date, time, and timestamp have no proposal for the default value. You cannot edit the DB Default field.

time

-

timestamp

-

Note

Not Null cannot be set for the JDBC types CLOB, BLOB, LONGVARCHAR, LONGVARBINARY, and BINARY.

Note

Key fields are automatically assigned an initial value.

 

End of Content Area