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