CHAR and VARCHAR types
Using the CHAR and VARCHAR data types with different databases.
The
CHAR
and VARCHAR
types are designed to store character
strings, but all database servers do not have the same semantics for these types.Important: The maximum size, supported characters sets and length semantics of
CHAR
and VARCHAR
types can be very different from one database
system to another. Consider using character types and sizes that are common across all the
database systems you target.The behavior of database servers may differ in the following areas related to
CHAR
/VARCHAR
types.
Database Server Type | Character types topic |
---|---|
IBM® DB2® LUW (UNIX™) | CHAR/VARCHAR in IBM DB2 |
IBM Informix® | CHAR/VARCHAR in IBM Informix |
IBM Netezza® | CHAR/VARCHAR in IBM Netezza |
Microsoft™ SQL Server | CHAR/VARCHAR in SQL Server |
Oracle® MySQL | CHAR/VARCHAR in Oracle MySQL |
Oracle Database Server | CHAR/VARCHAR in Oracle DB |
PostgreSQL | CHAR/VARCHAR in PostgreSQL |
SAP HANA® | CHAR/VARCHAR in SAP HANA |
SQLite | CHAR/VARCHAR in SQLite |