Torque Type | PostgreSQL | MySQL | Oracle | Sybase | SapDB | Interbase | Hypersonic | DB2 | DB2AS400 | Cloudscape | axion | MS Access | MS SQL |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Varchar* | varchar | VARCHAR | VARCHAR2 | VARCHAR | VARCHAR | VARCHAR | VARCHAR | VARCHAR | VARCHAR | VARCHAR | varchar | VARCHAR | VARCHAR |
Integer | integer | INTEGER | NUMBER | INT | INTEGER | INTEGER | INTEGER | INTEGER | INT | INT | INTEGER | integer | INT |
Numeric* | number | DECIMAL | NUMBER | NUMERIC | DECIMAL | n/a | NUMERIC | NUMERIC | NUMERIC | NUMERIC | NUMERIC | NUMERIC | NUMERIC |
Date | date | DATETIME | DATE | DATETIME | DATE | n/a | DATE | DATE | DATE | DATE | date | date | DATETIME |
Float* | float | FLOAT | FLOAT | FLOAT | FLOAT | n/a | FLOAT | FLOAT | FLOAT | FLOAT | FLOAT | FLOAT | FLOAT |
Char | char | CHAR | CHAR | CHAR | CHAR | VARCHAR | VARCHAR | VARCHAR | VARCHAR | CHAR | VARCHAR | VARCHAR | CHAR |
Blob | n/a | LONGBLOB | BLOB | n/a | LONG BYTE | n/a | n/a | BLOB | n/a | n/a | n/a | n/a | n/a |
Cblob | text | LONGTEXT | CBLOB | n/a | LONG UNICODE | n/a | n/a | CBLOB | n/a | n/a | n/a | n/a | |
Binary* | bytea- | BLOB | LONG RAW | BINARY | CHAR(254) BYTE | n/a | BINARY | CHAR(n) FOR BIT DATA | n/a | LONG BINARY | BINARY | BINARY | BINARY(7132) |
Bit | boolean | BIT | NUMBER (1,0) | BIT | FIXED(1,0) | n/a | BIT | n/a | n/a | BIT | BIT | BIT | BIT |
Booleanint* | int2 | INTEGER | NUMBER | INT | INTEGER | INTEGER | INTEGER | INTEGER | INT | INT | n/a | n/a | n/a |
Booleanchar* | char | CHAR | CHAR | CHAR | CHAR | VARCHAR | VARCHAR | VARCHAR | VARCHAR | CHAR | n/a | n/a | n/a |
Decimal* | decimal | DECIMAL | NUMBER | DECIMAL | DECIMAL | n/a | DECIMAL | DECIMAL | DEC | DECIMAL | INTEGER | DECIMAL | DECIMAL |
Longvarchar* | bytea- | MEDIUMTEXT- | VARCHAR(2000) | TEXT | LONG VARCHAR | VARCHAR | VARCHAR | LONG VARCHAR | LONG VARCHAR | LONG VARCHAR | VARCHAR | MEMO | TEXT |
Real* | float | REAL | NUMBER | REAL | REAL | n/a | REAL | REAL | REAL | REAL | REAL | REAL | REAL |
Smallint | int2 | SMALLINT | NUMBER(5,0) | SMALLINT | SMALLINT | n/a | SMALLINT | SMALLINT | SMALLINT | SMALLINT | SMALLINT | SMALLINT | SMALLINT |
Tinyint* | int2 | TINYINT | NUMBER(3,0) | TINYINT | CHAR BYTE | n/a | TINYINT | n/a | SMALLINT | TINYINT | TINYINT | TINYINT | TINYINT |
Time* | time | TIME- | DATE | TIMESTAMP | TIME | n/a | TIME | TIME | TIME | TIME | time | time | DATETIME |
Timestamp* | timestamp | TIMESTAMP | DATE | DATETIME | TIMESTAMP | TIMESTAMP | TIMESTAMP | TIMESTAMP | TIMESTAMP | TIMESTAMP | timestamp | timestamp | DATETIME |
Varbinary* | bytea- | MEDIUMBLOB- | BLOB | IMAGE | LONG BYTE | BLOB | BINARY | VARCHAR(n) FOR BIT DATA | VARCHAR(n) FOR BIT DATA | LONG BINARY | VARBINARY | BINARY | IMAGE |
(*) indicates that size might be required
(-) indicates that type produced with *defined* length (bytea())
but *undefined* length required (bytea). This have only been checked
on PostgreSQL and MySQL.
Note:
This table can be build from ${torque.home}/templates/base/${database}/db.props
Types java_object,null,other,array,ref,distinct
have been
removed, cause thay doesn't allow Torque-generator to produce SQL even if they
exist in torque DTD.
See also : DataType on PostgreSQL.com, Data Type on mysql.com