This topic contains the following topics:
You can use the following SQL data types to store alphanumeric data:
VARCHAR2 and NVARCHAR2 data types store variable-length character literals.
NCHAR and NVARCHAR2 data types store variable-length Unicode character data only.
CHAR and NCHAR data types store fixed-length character literals.
|
See Also:
|
When deciding which data type to use for a column that will store alphanumeric data in a table, consider the following points of distinction:
Space usage
To store data more efficiently, use the VARCHAR2 data type. The CHAR data type blank-pads and stores trailing blanks up to a fixed column length for all column values, whereas the VARCHAR2 data type does not add extra blanks.
Comparison semantics
Use the CHAR data type when you require ANSI compatibility in comparison semantics (when trailing blanks are not important in string comparisons). Use the VARCHAR2 when trailing blanks are important in string comparisons.
Future compatibility
The CHAR and VARCHAR2 data types are fully supported.
|
See Also: Oracle Database SQL Language Reference for more information on comparison semantics for these data types |