![]() |
Error Handling![]() ![]() ![]() ![]() ![]()
Run time errors arise from design faults, coding Mistakes, hardware failures, and many other sources. Although you cannot anticipate all possible errors, you can plan to handle certain kinds of errors meaningful to your PL/SQL block. With most programming languages, unless you disable error checking, a run time error such a "stack overflow "or" division by zero", stops normal processing and returns control to the operating system. With PL/SQL, a mechanism called exception handling lets you "bullet proof" a block so that it can continue operating in the presence of errors. What is an Exception? In PL/SQL a warning or error is called an exception. Exceptions can be internally defined (by the run time system) or user defined. When an exception is raised, processing jumps to the exception handlers An exception handler is a sequence of statements to be processed when a certain exception occurs. When an exception handler is complete, processing of the block terminates.
Why use Exceptions?
How to use Exceptions?
An internal exception is raised implicitly whenever the PL/SQL block violates a ORACLE rule exceeds a system dependent limit. Every ORACLE error has a number, but exception must be hand by name. So PL/SQL predefines some common errors as exceptions. Such predefined exceptions declared globally by PL/SQL.
For example, the predefined exception STORAGE ERROR is raised when PL/SQL runs out of memory
NO DATA FOUND is raised when a SELECT statement returns no rows, and ZERO DIVIDE
raised if a number is divided by zero Thus Internal Exceptions
|
|
Domain NamesSQL Database Management Systems Relational Database Management System Properties of RDBMS Client Server Computing Oracle Relational Database Database Structure and Space Management SQL Data Types How to Use Data Types? What is Operators and Conditions Character OperatorsOperator Precedence Data Retrieval Using SQL Plus SQL Data Definitions Data Retrieval Using Select SQL Operator Precedence Selecting Rows and Columns The Group by Clause
Having Clause Union, Union all, Intersact and Minus Commands Playing with Numbers Date Functions Example of Date Arithmetic Working with Null Values
Joining Tables and Subqueries Views Synonyms Indexes Clusters Sequences Formatting Query Results with SQL Plus Data Integrity The Optimizer How Oracle Optimizes SQL Statements Evaluating Expression and ConditionsOptimization Hints PL-SQL PL-SQL Architecture Error Reporting Functions Character Functions Composite Data Types PL-SQL Structures How to use PL-SQL Structures Normalization Operator Precedence Cursor Error Handling Database Triggers Types of Triggers Locking Sub Programs Packages New and Improved Data Types Improved Select Statement Advanced Quering Improved Scalability Improved Performance Via Partitioning Object Relational Features Heterogeneous Data Access Improved Security Administration New Data Types Improved Select Statement Changes to the Select Statement Improved Scalability Data Partitioning Oriented Toward Objects Character Functions Creating Object Types Created Nested Tables Oracle8 and Distributed Database Oracle8 Database Management and Security Distributed Database Invoking Export Invoking ImportWeb DesignWeb HostingE Commerce |
| Home | Web Hosting | Web Design | Sitemap |
| Copyright (C) 2007. Web Domain design hosting. All rights reserved. |