Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

Versions available for this page: CUBRID 8.3.1 |  CUBRID 8.4.0 |  CUBRID 8.4.1 |  CUBRID 9.0.0 | 

Functions and Operators

CAST Operator

By using CAST operator, you can execute an explicit type change between BLOB/CLOB type and binary type/string type. For more details, see CAST Operator.

Syntax

CAST (<bit_type_column_or_value> AS CLOB)

CAST (<bit_type_column_or_value> AS BLOB)

CAST (<char_type_column_or_value> AS BLOB)

CAST (<char_type_column_or_value> AS CLOB)  

LOB Data Process and Type Change Functions

The next table shows the functions provided to process and change BLOB/CLOB types.

Functional Expression

Description

CLOB_TO_CHAR (<clob_type_column>)

Changes number type, date/time type, and CLOB type to VARCHAR type.

BLOB_TO_BIT (<blob_type_column>)

Changes BLOB type to VARYING BIT type.

CHAR_TO_CLOB(<char_type_column_or_value>)

Changes text string type (CHAR, VARCHAR, NCHAR, NVACHAR) to CLOB type.

BIT_TO_BLOB(<blob_type_column_or_value>)

Changes bit array type (BIT, VARYING BIT) to BLOB type.

CHAR_TO_BLOB(<char_type_colulmn_or_value>)

Changes text string type (CHAR, VARCHAR, NCHAR, NVACHAR) to BLOB type.

CLOB_FROM_FILE(<file_pathname>)

Reads file details from the file path of VARCHAR type and changes to CLOB type data. <file_pathname> is analyzed to a path of server which is operated by the DB client, such as CAS or CSQL. If a path is specified targeting this, the upper path will be the current work direction of the process.
The statement that calls this function will not cache execution plans.

BLOB_FROM_FILE(<file_pathname>)

Reads file details from the file path of VARCHAR type, and changes to BLOB type data. The file path specified in is interpreted using the same method as the CLOB_FROM_FILE function.

CLOB_LENGTH(<clob_column>)

Returns the length of LOB data stored in a CLOB file in bytes.

BLOB_LENGTH(<blob_column>)

Returns the length of LOB data stored in a BLOB file in bytes.

<blob_or_clob_column> IS NULL

Use an IS NULL expression to compare whether it is a LOB column value (Locator) or NULL; returns TRUE if NULL.