Search notes:

Oracle PL/SQL: Exception Handlers

In a PL/SQL block, the exception handler is an optional portion at the blocks tail, introduced with the keywords EXCEPTION WHEN.
declare

  …         // Exceptions thrown in the declare section are NOT
            // handled in the exception handler below.
   
begin

  do_stuff; // Exceptions thrown in the exceutable section ARE
            // handled in the exception handler below.:w

EXCEPTION WHEN …

  /* The exception handler goes here. */

end;
/

See also

sqlerrm and sqlcode.
ORA-06512: at , line N
An exception handler can use dbms_utility.format_error_backtrace to find the source code line that caused the exception.

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758193860, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/Oracle/PL-SQL/block/exception-handler/index(60): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78