Convert multi-byte and single-byte characters in Oracle using TO_SINGLE_BYTE

By Santhosh N

This explains how to convert the both multi-byte and single-byte characters in oracle string to single-byte characters.

There is a conversion function in oracle by the name, TO_SINGLE_BYTE which converts all the multi-byte characters (also single-byte characters) to the single-byte characters.

Syntax: TO_SINGLE_BYTE (char)

Here char is the character that needs to be converted and it can be a char, varchar2, nchar, or nvarchar2 value.

Ex1: SELECT TO_SINGLE_BYTE('egg') FROM dual;
This returns “egg” as result, which is single byte.

Related FAQs

This explains how to convert the given number to the interval year to the month literal in oracle
Use Oracle TO_NUMBER to convert a string to a number and format the number in the desired nls language.
What is the real purpose of dual in oracle.
This explains how to convert the string to date format in oracle.
This explains how to convert the string to an interval Day to Second type in oracle.
This explains how to convert all the characters to the lower case alphabets
Convert multi-byte and single-byte characters in Oracle using TO_SINGLE_BYTE  (3033 Views)