TO_MULTI_BYTE function v15

TO_MULTI_BYTE returns char with all its single-byte characters converted to their corresponding multibyte characters. Char can be of data type CHAR, VARCHAR2, NCHAR, or NVARCHAR2. The value returned is in the same data type as char.

Any single-byte characters in char with no multibyte equivalents appear in the output string as single-byte characters. This function applies if your database character set contains single-byte and multibyte characters.

Examples

SELECT to_multi_byte('ABC&123') FROM dual;
Output
to_multi_byte  
----------------
ABC&123
(1 row)
SELECT octet_length('A') FROM dual;
Output
octet_length 
--------------
            1
(1 row)
SELECT octet_length(to_multi_byte('A')) FROM dual;
Output
octet_length 
--------------
            3
(1 row)
SELECT bit_length(to_multi_byte('A')) FROM dual;
Output
bit_length 
------------
         24
(1 row)
SELECT ascii(to_multi_byte('A')) FROM dual;
Output
ascii 
-------
 65313
(1 row)
SELECT to_hex(ascii(to_multi_byte('A'))) FROM dual;
Output
to_hex 
--------
 ff21
(1 row)