TO_MULTI_BYTE

2026-02-11 07:43:39  Updated

Purpose

This function converts all single-byte characters into the corresponding multibyte characters. This function is valid only if your database character set contains both single-byte and multibyte characters.

Syntax

TO_MULTI_BYTE(char)

Parameters

The char can be of the CHAR, VARCHAR2, NCHAR, or NVARCHAR2 data types. If a single-byte character in the char does not have a multibyte equivalent, it is displayed as a single-byte character in the output string.

Return type

The return value is of the same data type as char.

Examples

  • Convert from single-byte B to multi-byte B in UTF8.

    obclient> SELECT dump(TO_MULTI_BYTE( 'B')) FROM DUAL;
    +---------------------------+
    | DUMP(TO_MULTI_BYTE('B'))  |
    +---------------------------+
    | Typ=22 Len=3: 239,188,162 |
    +---------------------------+
    1 row in set
    
  • Convert all half-width characters to full-width characters.

    obclient> SELECT TO_MULTI_BYTE('China A') text FROM DUAL;
    +-----------+
    | TEXT      |
    +-----------+
    | China A |
    +-----------+
    1 row in set
    

Contact Us