Oracle Raise Error In Stored Procedure
user-defined exceptions whose names you decide. For more information, see "Defining Your Own PL/SQL Exceptions". Syntax raise statement ::= Description of the illustration raise_statement.gif Keyword and Parameter Description exception_name A predefined or user-defined exception. For a list of the predefined exceptions, see "Summary of Predefined PL/SQL Exceptions". Usage Notes PL/SQL blocks and subprograms should RAISE an exception only when an error makes it impractical to continue processing. You can code a RAISE statement for a given exception anywhere within the scope of that exception. When an exception is raised, if PL/SQL cannot find a handler for it in the current block, the exception propagates to successive enclosing blocks, until a handler is found or there are no more blocks to search. If no handler is found, PL/SQL returns an unhandled exception error to the host environment. In an exception handler, you can omit the exception name in a RAISE statement, which raises the current exception again. This technique allows you to take some initial corrective action (perhaps just logging the problem), then pass control to another handler that does more extensive correction. When an exception is reraised, the first block searched is the enclosing block, not the current block. Examples For examples, see the following: Example 1-12, "Creating a Stored Subprogram" Example 9-3, "Creating the emp_admin Package" Example 10-3, "Scope of PL/SQL Exceptions" Example 10-9, "Reraising a PL/SQL Exception" Related Topics "Exception Definition" Scripting on this page enhances content navigation, but does not change the content in any way.
errors. The latter are called exceptions. Note: The language of warning and error messages depends on the NLS_LANGUAGE parameter. For information about this parameter, see Oracle Database Globalization Support Guide. Topics Compile-Time Warnings Overview of Exception Handling Internally Defined Exceptions Predefined Exceptions User-Defined Exceptions Redeclared Predefined Exceptions Raising Exceptions Explicitly Exception Propagation Unhandled Exceptions Error Code and Error Message Retrieval Continuing Execution After Handling Exceptions Retrying Transactions After Handling Exceptions See http://docs.oracle.com/cd/B19306_01/appdev.102/b14261/raise_statement.htm Also: "Exception Handling in Triggers" "Handling FORALL Exceptions After FORALL Statement Completes" Tip: If you have problems creating or running PL/SQL code, check the Oracle Database trace files. The USER_DUMP_DEST initialization parameter specifies the current location of the trace files. You can find the value of this parameter by issuing SHOW PARAMETER USER_DUMP_DEST. For more information https://docs.oracle.com/cd/E11882_01/appdev.112/e25519/errors.htm about trace files, see Oracle Database Performance Tuning Guide. Compile-Time Warnings While compiling stored PL/SQL units, the PL/SQL compiler generates warnings for conditions that are not serious enough to cause errors and prevent compilation—for example, using a deprecated PL/SQL feature. To see warnings (and errors) generated during compilation, either query the static data dictionary view *_ERRORS (described in Oracle Database Reference) or, in the SQL*Plus environment, use the command SHOW ERRORS. The message code of a PL/SQL warning has the form PLW-nnnnn. For the message codes of all PL/SQL warnings, see Oracle Database Error Messages. Table 11-1 summarizes the categories of warnings. Table 11-1 Compile-Time Warning Categories Category Description Example SEVERE Condition might cause unexpected action or wrong results. Aliasing problems with parameters PERFORMANCE Condition might cause performance problems. Passing a VARCHAR2 value to a NUMBER column in an INSERT statement INFORMATIONAL Condition does not affect performance or correctness, but you might want to change it to make the code more maintainable. Code that ca
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers http://stackoverflow.com/questions/23610339/how-to-catch-error-in-procedure-that-was-raised-inside-other-procedure-oracle or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up how to catch error in procedure that was raised inside other procedure , oracle SQL 10g up vote -3 down vote favorite I have other_procedure which can do a RAISE_APPLICATION_ERROR(-20001,'Some text here'); When an oracle raise error happens I want to jump to the end of the loop, which I do. But I don't know how to catch that error. Please note that I'm using Oracle 10g, so I can't use continue so that's why I use GOTO. I tried this, but with exception it won't compile. create or replace procedure my_procedure as begin for item IN some_cursor LOOP if(condition) then other_procedure; exception when -20001 then goto end_loop; --some code here end if; <