Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

Versions available for this page: CUBRID 8.4.3 |  CUBRID 9.0.0 | 

Overview

An implicit type conversion represents an automatic conversion of a type of expression to a corresponding type. SET, MULTISET, LIST and SEQUENCE should be converted explicitly.

If you convert the DATETIME and the TIMESTAMP types to the DATE type or the TIME type, data loss may occur. If you convert the DATE type to the DATETIME type or the TIMESTAMP type, the time will be set to '12:00:00 AM.'

If you convert a string type or an exact numeric type to a floating-point numeric type, the value may not be accurate. Because a string type and an exact type use a decimal precision to represent the value, but a floating-point numeric type uses a binary precision.

The implicit type conversion executed by CUBRID is as follows:

Implicit Type Conversion Table 1

From \ To

DATETIME

DATE

TIME

TIMESTAMP

DOUBLE

FLOAT

NUMERIC

BIGINT

DATETIME

-

O

O

O

DATE

O

-

O

TIME

-

TIMESTAMP

O

O

O

-

DOUBLE

-

O

O

O

FLOAT

O

-

O

O

NUMERIC

O

O

-

O

BIGINT

O

O

O

-

INT

O

O

O

O

O

SHORT

O

O

O

O

MONETARY

O

O

O

O

BIT

VARBIT

CHAR

O

O

O

O

O

O

O

O

VARCHAR

O

O

O

O

O

O

O

O

NCHAR

O

O

O

O

O

O

O

O

VARNCHAR

O

O

O

O

O

O

O

O

Implicit Type Conversion Table 2

From \ To

INT

SHORT

MONETARY

BIT

VARBIT

CHAR

VARCHAR

NCHAR

VARNCHAR

DATETIME

O

O

O

O

DATE

O

O

O

O

TIME

O

O

O

O

TIMESTAMP

O

O

O

O

DOUBLE

O

O

O

O

O

O

O

FLOAT

O

O

O

O

O

O

O

NUMERIC

O

O

O

O

O

O

O

BIGINT

O

O

O

O

O

O

O

INT

-

O

O

O

O

O

O

SHORT

O

-

O

O

O

O

O

MONETARY

O

O

-

O

O

O

O

BIT

-

O

O

O

O

O

VARBIT

O

-

O

O

O

O

CHAR

O

O

O

O

O

-

O

O

O

VARCHAR

O

O

O

O

O

O

-

O

O

NCHAR

O

O

O

O

O

O

O

-

O

VARNCHAR

O

O

O

O

O

O

O

O

-