Purpose
This function converts a string from one character set to another.
Syntax
CONVERT(char, dest_char_set[, source_char_set])
Parameters
| Parameter | Description |
|---|---|
| char | The string to be converted. It can be of any data type, such as CHAR, VARCHAR2, NCHAR, NVARCHAR2, or CLOB. |
| dest_char_set | The name of the character set to which the string is to be converted. |
| source_char_set | The name of the character set in which the string is stored in the database. If not specified, the default value is the database character set. |
Return type
If the data type of
charisCHARorVARCHAR2, the return type isVARCHAR2.If the data type of
charisNCHARorNVARCHAR2, the return type isNVARCHAR2.If the data type of
charisCLOB, the return type isCLOB.
Examples
Convert the string Ä Ê Í a b c d to the ZHS16GBK character set.
obclient> SELECT CONVERT('Ä Ê Í a b c d', 'ZHS16GBK') FROM DUAL;
+----------------------------------+
| CONVERT('ÄÊÍABCD','ZHS16GBK') |
+----------------------------------+
| ? ? ? a b c d |
+----------------------------------+
1 row in set
