Purpose
This function converts data of the NCHAR, NVARCHAR2, or CLOB data type to the VARCHAR2 data type.
Note
When the function converts a LOB character to the database character set, if the value of the LOB to be converted exceeds the target type, an error is returned by the database.
Syntax
TO_CHAR(character)
Parameters
The character parameter specifies the expression to be converted to the VARCHAR2 data type. The data type can be NCHAR, NVARCHAR2, or CLOB.
Return type
VARCHAR2
Examples
Convert the string 010101 to character data.
obclient> SELECT TO_CHAR('010101') FROM DUAL;
+-------------------+
| TO_CHAR('010101') |
+-------------------+
| 010101 |
+-------------------+
1 row in set
