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 does not support this function.
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 to a VARCHAR string. |
| src_charset | The character set from which the RAW data is exported. If src_charset is NULL, the database character set is used. |
Considerations
If the user specifies an invalid character set, NULL data, or data of length 0, the 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
