Database & SQL/DB일반

VARCHAR vs VARCHAR2

YuMa726 2020. 6. 23. 09:39

Character string values storage:
1. CHAR:
§ Stores strings of fixed length.
§ The length parameter s specifies the length of the strings.
§ If the string has smaller length it padded with
 space at the end
§ It will waste of a lot of disk space.
§ If the string has bigger length it truncated to the scale number of the string.

2. VARCHAR:
§ Stores strings of variable length.
§ The length parameter specifies the maximum length of the strings
§ It stores up to 2000 bytes of characters
§ It will occupy space for NULL values
§ The total length for strings is defined when database was created.

3. VARCHAR(2):
§ Stores strings of variable length.
§ The length parameter specifies the maximum length of the strings
§ It stores up to 4000 bytes of characters
§ It will not occupy space for NULL values
§ The total length of strings is defined when strings are given



Read more:
 http://wiki.answers.com/Q/What_is_difference_between_varchar_and_varchar2#ixzz1y8EQfB7P