Share this page:

oracle tutorial

Oracle/PLSQL: CONVERT Function

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

Description

The Oracle/PLSQL CONVERT function converts a string from one character set to another.

Syntax

The syntax of the CONVERT function is:

CONVERT( string1 , char_set_to , [ char_set_from ] )

Parameters or Arguments

string1 is the string to be converted.

char_set_to is the character set to convert to.

char_set_from is the character set to convert from.

Note

Character sets include:

Character Set Description
US7ASCII US 7-bit ASCII character set
WE8DEC West European 8-bit character set
WE8HP HP West European Laserjet 8-bit character set
F7DEC DEC French 7-bit character set
WE8EBCDIC500 IBM West European EBCDIC Code Page 500
WE8PC850 IBM PC Code Page 850
WE8ISO8859P1 ISO 8859-1 West European 8-bit character set

Applies To

The CONVERT 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 CONVERT function examples and explore how to use the CONVERT function in Oracle/PLSQL.

For example:

CONVERT('A B C D E Ä Ê Í Õ Ø', 'US7ASCII', 'WE8ISO8859P1')
Result: 'A B C D E A E I ? ?'