Assignment operations are performed during the execution of INSERT and UPDATE statements. Comparison operations are performed during the execution of statements that include predicates. The data types of the operands involved must be compatible, as shown in Tabela 16 through Tabela 18.
If the data type column contains:
Tabela 16. Data type compatibility, table 1
SQL data type | INT | SMALLINT | DECIMAL | BLOB |
---|---|---|---|---|
INT | X | X | X |
|
VARCHAR |
|
|
|
|
BLOB |
|
|
| X |
DECIMAL | X | X | X |
|
CHAR |
|
|
|
|
SMALLINT | X | X | X |
|
DATE |
|
|
|
|
TIME |
|
|
|
|
TIMESTAMP |
|
|
|
|
Tabela 17. Data type compatibility, table 2
SQL data type | CHAR | VARCHAR |
---|---|---|
INT |
|
|
VARCHAR | X | X |
BLOB |
|
|
DECIMAL |
|
|
CHAR | X | X |
SMALLINT |
|
|
DATE | X | X |
TIME | X | X |
TIMESTAMP | X | X |
Tabela 18. Data type compatibility, table 3
SQL data type | DATE | TIME | TIMESTAMP |
---|---|---|---|
INT |
|
|
|
VARCHAR | X | X | X |
BLOB |
|
|
|
DECIMAL |
|
|
|
CHAR | X | X | X |
SMALLINT |
|
|
|
DATE | X |
|
|
TIME |
| X |
|
TIMESTAMP |
|
| X |
Informacje pokrewne