Raise_application_error Error Range
Contents |
to your PL/SQL program. With many programming languages, unless you disable error checking, a raise_application_error example run-time error such as stack overflow or division by zero
Ora 21000 Error Number Argument To Raise_application_error Of Is Out Of Range
stops normal processing and returns control to the operating system. With PL/SQL, a mechanism called raise_application_error syntax exception handling lets you bulletproof your program so that it can continue operating in the presence of errors. This chapter contains these topics: Overview of difference between raise and raise_application_error in oracle PL/SQL Runtime Error Handling Advantages of PL/SQL Exceptions Summary of Predefined PL/SQL Exceptions Defining Your Own PL/SQL Exceptions How PL/SQL Exceptions Are Raised How PL/SQL Exceptions Propagate Reraising a PL/SQL Exception Handling Raised PL/SQL Exceptions Overview of PL/SQL Compile-Time Warnings Overview of PL/SQL Runtime Error Handling In PL/SQL, an
Raise_application_error(-20001
error condition is called an exception. Exceptions can be internally defined (by the runtime system) or user defined. Examples of internally defined exceptions include division by zero and out of memory. Some common internal exceptions have predefined names, such as ZERO_DIVIDE and STORAGE_ERROR. The other internal exceptions can be given names. You can define exceptions of your own in the declarative part of any PL/SQL block, subprogram, or package. For example, you might define an exception named insufficient_funds to flag overdrawn bank accounts. Unlike internal exceptions, user-defined exceptions must be given names. When an error occurs, an exception is raised. That is, normal execution stops and control transfers to the exception-handling part of your PL/SQL block or subprogram. Internal exceptions are raised implicitly (automatically) by the run-time system. User-defined exceptions must be raised explicitly by RAISE statements, which can also raise predefined exceptions. To handle raised
SQL TuningSecurityOracle UNIXOracle LinuxMonitoringRemote supportRemote plansRemote servicesApplication Server ApplicationsOracle FormsOracle PortalApp UpgradesSQL ServerOracle ConceptsSoftware SupportRemote Support Development Implementation Consulting StaffConsulting PricesHelp Wanted! Oracle PostersOracle Books Oracle Scripts Ion Excel-DB Don Burleson Blog raise_application_error parameters
RAISE_APPLICATION_ERROR tips Oracle pragma exception_init and raise application error Database Tips by Burleson Consulting March 3, 2015 Question: What does the PL/SQL raise_application_error code do? Answer: The raise_application_error isRaise Application Error In Oracle Triggers
actually a procedure defined by Oracle that allows the developer to raise an exception and associate an error number and message with the procedure. This allows the application to raise application errors rather https://docs.oracle.com/cd/B19306_01/appdev.102/b14261/errors.htm than just Oracle errors. Error numbers are defined between -20,000 and -20,999. Oracle provides the raise_application_error procedure to allow you to raise custom error numbers within your applications. You can generate errors and their associated text starting with -20000 and proceeding through -20999 (a grand total of 1,000 error numbers that you can use). Below we illustrate the use of the raise_application_error procedure. Using the http://www.dba-oracle.com/t_raise_application_error.htm raise_application_error procedure: DECLARE Balance integer := 24; BEGIN IF (nBalance <= 100) THEN Raise_Application_Error (-20343, 'The balance is too low.');END IF;END; In this example, error number -20343 is raised if the value of nBalance isn't greater than 100, yielding a message that looks like this: ORA-20343: The balance is too low. All other numbers belong to Oracle for its own errors. The message can be anything that will fit in a varchar2(2000). The final parameter passed to the procedure is a Boolean(true/false) that tells the procedure to add this error to the error stack or replace all errors in the stack with this error. Passing the value of 'True' adds the error to the current stack, while the default is 'False'. SQL> create or replace procedure test_var2 (n_test IN number := 0,3 n_result OUT number)4 as5 begin 6 if n_test > 100 then7 raise_application_error(-20010,'Number Too Large');8 end if;9 n_result := n_test;10 end; 11 / Procedure created. SQL> declare2 n_numb number := &Number;3 n_2 number := 0;4 begin5 test_var(n_numb, n_2);6 dbms_output.put_line(n_2);7 end;8 /Enter value for number: 5old 2: n_numb number := &Number;new 2: n_numb number := 5;5 PL/SQL procedure successfully completed. SQL> /Enter value for numbe
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 http://stackoverflow.com/questions/2918692/regarding-ora-21000 Us Learn more about Stack Overflow the company Business Learn more about hiring http://ora-21000.ora-code.info/ developers 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 Regarding ORA 21000 up vote 1 in oracle down vote favorite I am struggling with an ORA 21000 which says ORA-21000: error number argument to raise_application_error of 3739 is out of range. This error is coming intermittently. I am not sure why this is occurring. This worked absolutely fine earlier, but after migrating to Linux from Solaris, this error has suddenly come up. Googling it didn't help. Please help. Thanks in Advance. database oracle10g share|improve raise application error this question asked May 27 '10 at 5:32 Sid 1,97942259 add a comment| 1 Answer 1 active oldest votes up vote 5 down vote accepted RAISE_APPLICATION_ERROR is a method by which an application can raise a custom error in Oracle, which is why there will be no documentation about your error message. This procedure accepts an error number argument, which must be in the range -20000 to -20999. Looks like your application is trying to raise 3739 which is not allowed. This is a defect in your application. share|improve this answer answered May 27 '10 at 7:02 Jeffrey Kemp 37.1k859104 Yes, but I have searched everywhere in my application and this error code 3739 is nowhere to be found. Any reason why it has started to show up suddenly? And I did not find anything related to ORA 3739... –Sid May 27 '10 at 8:03 You will have to trace it back to its source somehow. Examine all calls to RAISE_APPLICATION_ERROR in your code, perhaps the error code is being passed via a variable (although, hopefully, it is encoded in a constant somewhere). –Jeffrey Kemp May 27 '10 at 10:51 add a c
ORA-01429 ORA-01480 ORA-01555 ORA-03237 ORA-04030 ORA-04031 ORA-04091 ORA-12154 ORA-21000 ORA-28009 ORA-28009 PLS-00222 ORA-21000:error number argument to raise_application_error is out of range Submitted by sreemen on Fri, 11/13/2009 - 18:24 ORA-21000:error number argument to raise_application_error is out of range ORA-21000:error number argument to raise_application_error of stringstring is out of range Cause:An attempt was made to specify a number not in the allowed range. Action:Use an error number in the range of -20000 to -20999, inclusive. ORA-21000: "error number argument to raise_application_error of 0 is out of range": The PL/SQL RAISE_APPLICATION_ERROR procedure has been called with an error code of 0. The only valid error codes are 20000 to 20099. The usualy cause for a value of 0 being used is that a program has failed to set amn error variable correctly, e.g. it has called an exception but not set the variable. Search Results Enter your keywords: Search the web Search www.ora-code.info View the results at Google, or enable JavaScript to view them here. User login Username: * Password: * Request new password Oracle Errors ORA-00001 ORA-00017 ORA-00018 ORA-00019 ORA-00020 ORA-00021 ORA-00022 ORA-00023 ORA-00024 ORA-00025 ORA-00026 ORA-00027 ORA-00028 ORA-00029 ORA-00030 ORA-00054 ORA-00055 ORA-00060 ORA-00257 ORA-00600 ORA-00604 ORA-00936 ORA-00997 ORA-01000 ORA-01422 ORA-01429 ORA-01480 ORA-01555 ORA-03237 ORA-04030 ORA-04031 ORA-04091 ORA-12154 ORA-21000 ORA-28009 ORA-28009 PLS-00222 Tip of the day Refer to asktom.oracle.com for oracle design and performance related topics Oracle Search Search the web Search www.ora-code.info Recent blog posts Checking and Adding Space to tablespace more Real Time Tariffic Feedjit Live Blog Stats '