## Syntax ```mermaid %%{init: { 'theme': 'base', 'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' }, 'themeVariables': { 'fontSize': '11px', 'fontFamily': 'Arial' } }}%% flowchart LR Start((START)) --> TO_CHAR[TO_CHAR]:::quoted TO_CHAR --> End((END)) ``` ## Purpose The `TO_CHAR` SQL function converts a value into text. Parameters: - Input (`ANY`): value to convert. - Format (optional, `varchar2`): format mask. Defaults to US American style. The list of format masks is available in [[Format Masks]]. Returns: the input converted to text. ## Examples The following example converts a date to text using a format mask: ```sql select to_char(to_date('20260703', 'YYYYMMDD'), 'DD-MM-YYYY') ------------------- 03-07-2026 ``` The following example converts a number to text: ```sql select to_char(123.45) ------------------- 123.45 ```