MattsBits
MattsBits

MattsBits

Generate Oracle Error Codes In PLSQL  

by Matt Hawkins, 02/02/2011
Categories : Oracle

While developing Oracle applications you may come across any number of error codes. The following PLSQL code can generate the appropriate error message for a given range of error codes and raised exceptions.

BEGIN
-- Generate range of error messages
FOR error_num IN 1000..1010 LOOP
dbms_output.put_line(SQLERRM(-error_num));
END LOOP;
END;


This makes use of the SQLERRM function and will give you the output :

ORA-01000: maximum open cursors exceeded
ORA-01001: invalid cursor
ORA-01002: fetch out of sequence
ORA-01003: no statement parsed
ORA-01004: default username feature not supported; logon denied
ORA-01005: null password given; logon denied
ORA-01006: bind variable does not exist
ORA-01007: variable not in select list
ORA-01008: not all variables bound
ORA-01009: missing mandatory parameter
ORA-01010: invalid OCI operation

Author : Matt Hawkins  Last Edit By : Matt Hawkins
PHP Powered  MySQL Powered  Valid XHTML 1.0  Valid CSS  Firefox - Take Back The Web  EUKHost - Recommended Webhosting Solutions

MattHawkins CMS v3.0 - Copyright 2009-2022