What are the 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 typeDB2 Default value
CHARSpaces
VarcharEmpty string having length 0
TIMESTAMPCurrent timestamp
INTEGERZero

Updated on: 14-Sep-2020

702 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements