Data Type Conversion
Certain data types in the database support implicit data type conversions, such as assignments and parameters called by functions. For other data types (for example, INT and composite types), you can use the type conversion functions provided by GaussDB, such as the CAST function, to forcibly convert them.
Table 1 lists common implicit data type conversions in GaussDB.
The valid value range of DATE supported by GaussDB is from 4713 BC to 294276 AD.
Raw Data Type |
Target Data Type |
Remarks |
---|---|---|
CHAR |
VARCHAR2 |
- |
CHAR |
NUMBER |
Raw data must consist of digits. |
CHAR |
DATE |
Raw data cannot exceed the valid date range. |
CHAR |
RAW |
- |
CHAR |
CLOB |
- |
VARCHAR2 |
CHAR |
- |
VARCHAR2 |
NUMBER |
Raw data must consist of digits. |
VARCHAR2 |
DATE |
Raw data cannot exceed the valid date range. |
VARCHAR2 |
CLOB |
- |
NUMBER |
CHAR |
- |
NUMBER |
VARCHAR2 |
- |
DATE |
CHAR |
- |
DATE |
VARCHAR2 |
- |
RAW |
CHAR |
- |
RAW |
VARCHAR2 |
- |
CLOB |
CHAR |
- |
CLOB |
VARCHAR2 |
- |
CLOB |
NUMBER |
Raw data must consist of digits. |
INT4 |
CHAR |
- |
INT4 |
BOOLEAN |
- |
BOOLEAN |
INT4 |
- |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot