Skip to main content
Version: V1.1.0

TO_CHAR(character)

Description​

This function converts character data to a VARCHAR string.

Syntax​

TO_CHAR(character)

Parameters​

character: the character data to convert.

Return Type​

  • Returns data of the VARCHAR type.
  • Returns NULL if the character value is NULL.

Examples​

SELECT TO_CHAR('Hello, World!'), TO_CHAR(NULL);

The return result is as follows:

+--------------------------+---------------+
| TO_CHAR('Hello, World!') | TO_CHAR(NULL) |
+--------------------------+---------------+
| Hello, World! | NULL |
+--------------------------+---------------+
1 row in set (0.001 sec)

References​