## Syntax ```mermaid %%{init: { 'theme': 'base', 'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' }, 'themeVariables': { 'fontSize': '11px', 'fontFamily': 'Arial' } }}%% flowchart LR Start((START)) --> SQLERRM[SQLERRM]:::quoted SQLERRM --> End((END)) ``` ## Purpose The `SQLERRM` SQL function gets the error message of the last SQL error that occurred during execution. The function can be used without parentheses. See also [[SQLCODE]] and [[SQLROWCOUNT]]. Returns: the error message of the last error as `varchar2`. Returns `null` when no error occurred. ## Examples The following example retrieves the error message of the last error; the output is empty since no error occurred: ```sql select sqlerrm ------------------- ```