SQL Dialects Reference/Data structure definition/Data types/Character types
From Wikibooks, the open-content textbooks collection
[edit] Character types
This page includes comparison tables which can be big and complex.
While it's perfectly all right to view them in their complete state, it is recommended to install a comparison tables extension that would allow to select particular columns of interest for comparison.
| Data type | DB2 | Firebird | Ingres | MSSQL | MySQL | Oracle | PostgreSQL | SQLite | OpenLink Virtuoso | Linter |
|---|---|---|---|---|---|---|---|---|---|---|
| Variable-length with limit | VARCHAR(n) | VARCHAR(n) | VARCHAR(n) NVARCHAR(n) |
VARCHAR(n) NVARCHAR(n) |
VARCHAR(n) | VARCHAR2(n) VARCHAR(n) is slated for deprecation |
VARCHAR(n) | VARCHAR(n) | VARCHAR(n) | VARCHAR(n) NVARCHAR(n) |
| Fixed-length, blank padded string | CHAR(n) | CHAR(n) | CHAR(n) NCHAR(n) |
CHAR(n) NCHAR(n) |
CHAR(n) | CHAR(n) | CHAR(n) | CHAR(n) | CHAR(n) | CHAR(n) NCHAR(n) |
| Text | CLOB | BLOB SUB_TYPE 1 | TEXT, CLOB, NCLOB, LONG VARCHAR, LONG NVARCHAR |
TEXT / NTEXT VARCHAR(MAX) / NVARCHAR(MAX) [1] |
TEXT[2] | CLOB | TEXT | TEXT[2] | LONG VARCHAR | BLOB - the same as long binary objects |
Notes: