totn Oracle Functions

Oracle / PLSQL: TO_SINGLE_BYTE Function

This Oracle tutorial explains how to use the Oracle/PLSQL TO_SINGLE_BYTE function with syntax and examples.

Description

The Oracle/PLSQL TO_SINGLE_BYTE function returns a character value with all of the multibyte characters converted to single-byte characters. To use this function, your database character set contains both single-byte and multibyte characters.

Syntax

The syntax for the TO_SINGLE_BYTE function in Oracle/PLSQL is:

TO_SINGLE_BYTE( char )

Parameters or Arguments

char
A char, varchar2, nchar, or nvarchar2 value that will be converted to single-byte characters. This function will return its result in the same character set as char.

Returns

The TO_SINGLE_BYTE function returns a single byte value.

Applies To

The TO_SINGLE_BYTE function can be used in the following versions of Oracle/PLSQL:

  • Oracle 12c, Oracle 11g, Oracle 10g, Oracle 9i, Oracle 8i

Example

Let's look at some Oracle TO_SINGLE_BYTE function examples and explore how to use the TO_SINGLE_BYTE function in Oracle/PLSQL.

For example:

select TO_SINGLE_BYTE('Tech on the net')
from dual;

The SQL statement above would return a single-byte character value.