Search notes:

Oracle PL/SQL: Exceptions

Each exception is associated with a numerical code. In an exception handler, this code can be queried from the function sqlcode.

Predefined exceptions

Oracle has some predefined exceptions:
Name Error Code
access_into_null -6530
case_not_found -6592
collection_is_null -6531
cursor_already_open -6511
dup_val_on_index -1
invalid_cursor -1001
invalid_number -1722
login_denied -1017
no_data_found +100 Compare with ORA-01403: no data found. Compare with exception too_many_rows
no_data_needed -6548
not_logged_on -1012
program_error -6501
rowtype_mismatch -6504
self_is_null -30625
storage_error -6500
subscript_beyond_count -6533
subscript_outside_limit -6532
sys_invalid_rowid -1410
timeout_on_resource -51
too_many_rows -1422 Compare with no_data_found
value_error -6502
zero_divide -1476

See also

Throwing and catching exceptions, exception handlers
raise_application_error raises an exception.
when X or Y

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...', 1759561885, '216.73.216.149', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/Oracle/PL-SQL/exception/index(74): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78