Default Values Used by DB2 for Various Data Types



DB2 provides a facility to insert a default value in case the user does not give any value for the column. For each DB2 data type there is a fixed default value which will be assigned to the column (which was defined with ‘DEFAULT’ parameter during table creation) if the value is not given during insertion.

Below table gives the DB2 default values for CHAR, VARCHAR, TIMESTAMP and INTEGER.

Data type DB2 Default value
CHAR Spaces
Varchar Empty string having length 0
TIMESTAMP Current timestamp
INTEGER Zero
Updated on: 2020-09-14T14:21:06+05:30

1K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements