What are SQLCODE and SQLERRM and why are they important for PL/SQL developers?


  • When a SQL statement raises an exception, Oracle captures the error codes by using the SQLCODE and SQLERRM globally-defined variables.
  • SQLCODE and SQLERRM can track exceptions that are handled by the OTHERS clause of the exception handler.
  • SQLCODE returns the current error code from the error stack and the error message from the current error.