This article is written about 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
The string to be converted.
char_set_to
The character set to convert to.
char_set_from
Optional. The character set to convert from.
Returns
The CONVERT function returns a string value in particular character set. The available character sets are:
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 ? ?'
Leave a Review