LOB Functions

BIT_TO_BLOB

BIT_TO_BLOB(blob_type_column_or_value)

This function converts BIT or VARYING BIT type into BLOB type.

Parameters:

blob_type_column_or_value – Target column or value to convert

Return type:

BLOB

BLOB_FROM_FILE

BLOB_FROM_FILE(file_pathname)

This function read the contents from the file with VARCHAR type data and returns BLOB type data.

Parameters:

file_pathname – the path on the server which DB clients like CAS or CSQL are started

Return type:

BLOB

SELECT CAST(BLOB_FROM_FILE('local:/home/cubrid/demo/lob/ces_622/image_t.00001352246696287352_4131')
   AS BIT VARYING) result;

SELECT CAST(BLOB_FROM_FILE('file:/home/cubrid/demo/lob/ces_622/image_t.00001352246696287352_4131')
   AS BIT VARYING) result;

BLOB_LENGTH

BLOB_LENGTH(blob_column)

The length of LOB data stored in BLOB file is returned.

Parameters:

clob_column – The column to get the length of BLOB

Return type:

INT

BLOB_TO_BIT

BLOB_TO_BIT(blob_type_column)

This function converts BLOB type to VARYING BIT type.

Parameters:

blob_type_column – Target column to convert

Return type:

VARYING BIT

CHAR_TO_BLOB

CHAR_TO_BLOB(char_type_column_or_value)

This function converts CHAR or VARCHAR type into BLOB type.

Parameters:

char_type_column_or_value – Target column or value to convert

Return type:

BLOB

CHAR_TO_CLOB

CHAR_TO_CLOB(char_type_column_or_value)

This function converts CHAR or VARCHAR type into CLOB type.

Parameters:

char_type_column_or_value – Target column or value to convert

Return type:

CLOB

CLOB_FROM_FILE

CLOB_FROM_FILE(file_pathname)

This function read the contents from the file with VARCHAR type data and returns CLOB type data.

Parameters:

file_pathname – the path on the server which DB clients like CAS or CSQL are started

Return type:

CLOB

If you specify the file_pathname as the relative path, the parent path will be the current working directory.

For the statement including this function, the query plan is not cached.

SELECT CAST(CLOB_FROM_FILE('local:/home/cubrid/demo/lob/ces_622/image_t.00001352246696287352_4131')
   AS VARCHAR) result;

SELECT CAST(CLOB_FROM_FILE('file:/home/cubrid/demo/lob/ces_622/image_t.00001352246696287352_4131')
   AS VARCHAR) result;

CLOB_LENGTH

CLOB_LENGTH(clob_column)

The length of LOB data stored in CLOB file is returned.

Parameters:

clob_column – The column to get the length of CLOB

Return type:

INT

CLOB_TO_CHAR

CLOB_TO_CHAR(clob_type_column [USING charset] )

This function converts CLOB type into VARCHAR type.

Parameters:
  • clob_type_column – Target column to convert

  • charset – The character set of string to convert. It can be utf8, euckr or iso88591.

Return type:

STRING