RAW_TO_CHAR

2024-06-28 05:30:31  Updated

The RAW_TO_CHAR function converts RAW data from a valid character set to a VARCHAR string in the database character set.

Applicability

This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the MySQL mode.

Syntax

 UTL_I18N.RAW_TO_CHAR (
     data             IN RAW,
     src_charset      IN VARCHAR := NULL )
  RETURN VARCHAR AS ret VARCHAR(32767);

Parameters

Parameter Description
data The RAW data to be converted into a VARCHAR string.
src_charset The character set from which the RAW data is exported. If the value of src_charset is NULL, the database character set is used.

Considerations

If you specify an invalid character set or data that is NULL or 0 in length, this function returns a NULL string.

Examples

obclient> SELECT UTL_I18N.RAW_TO_CHAR(hextoraw('616263646566C2AA'), 'utf8') FROM DUAL;
+-----------------------------------------------------------+
| UTL_I18N.RAW_TO_CHAR(HEXTORAW('616263646566C2AA'),'UTF8') |
+-----------------------------------------------------------+
| abcdefª                                                   |
+-----------------------------------------------------------+
1 row in set

Contact Us