Let's mainframe!
Distinction between CHAR and VARCHAR data types -
CHAR data type has a predetermined maximum length, while VARCHAR data type is a varying length character string.
So, it means, Char will always have the same length to store the text, but VARCHAR alters its length based on the length of the string which has to be stored, which helps in saving memory.
The CHAR data type in DB2 stores character data in a fixed-length field. It can store letters, numbers, and other characters which are supported.
However, VARCHAR data type is a varying-length character string that can contain letters, numbers, and special characters.
#mainframe #db2