Oracle Certified Professional DBA Certification Exam Guide

Oracle Certified Professional DBA Certification Exam Guide

by Jason S. Couchman
     
 
The Oracle Certified Profession (OCP) designation is proofof your ability to handle the demands of today's increasingly complex system environments. Certify yur skills—and demonstrate your expertise—by earning your OCP credential. In addition,the guide covers the Oracle8 upgrade exam for DBAs who want to extend their certification to include Oracle8.

Overview

The Oracle Certified Profession (OCP) designation is proofof your ability to handle the demands of today's increasingly complex system environments. Certify yur skills—and demonstrate your expertise—by earning your OCP credential. In addition,the guide covers the Oracle8 upgrade exam for DBAs who want to extend their certification to include Oracle8. Fully endorsed by Oracle Corporation and developed in conjunction with Oracle's OCP program,this book with CD-ROM is a powerful preparation tool that features more than 450 exam questions. Featuring a logical methodology designed to reinforce your learning experience,this guide offers the following study aids: tips,examples,and exercises to help you remember key concepts; two-minute drills—quick and concise checklists that summarize a chapter's main points; perfect for last-minute review; chapter self-tests—chapter-specific questions similar to those found on the exam with detailed answers to each question; the latest information on the new scenario-based exam questions; comprehensive coverage of Oracle-designated exam objectives,including SQL and Pl/SQL,advanced performance tuning,database administration,backup and recovery,Oracle8,and much more; interactive exam on CD allows you to hotlink directly to the relevant part of the text—the entire book is in electronic format. Make a smart career move and begin enjoying all the rewards of OCP certification. This officially endorsed study guide offers a complete preparation system geared to help you pass your exams with flying colors!

Product Details

ISBN-13:
9780078825491
Publisher:
McGraw-Hill Companies, The
Publication date:
07/28/1998
Series:
Oracle Press Series
Edition description:
CD-ROM included
Pages:
1257
Product dimensions:
7.69(w) x 9.43(h) x 2.74(d)

Related Subjects

Read an Excerpt

Chapter 5: Introducing PL/SQL

Error Handling

In this section, you will cover the following areas related to error handling:

The three basic types of exceptions
Identifying common exceptions
Coding the exception handler

The handling of errors in PL/SQL is arguably the best contribution PL/SQL makes to commercial programming. Errors in PL/SQL need not be trapped and handled with if statements directly within the program, as they are in other procedural languages like C. Instead, PL/SQL allows the developer to raise exceptions when an error condition is identified and switch control to a special program area in the PL/SQL block, called the exception handler. The code to handle an error does not clutter the executable program logic in PL/SQL, nor is the programmer required to terminate programs with return or exit statements. The exception handler is a cleaner way to handle errors.

Three Basic Types of Exceptions

The three types of exceptions in Oracle PL/SQL are predefined exceptions, user-defined exceptions, and pragma exceptions. Exception handling in PL/SQL offers several advantages. These advantages are simplicity and flexibility. Predefined exceptions offer the developer several built-in problems that can be checked. User-defined and pragma exceptions allow for additional flexibility to build in a level of support for errors defined by the user into PL/SQL. The following discussions will illustrate the use of predefined, user-defined, and pragma exceptions.

Predefined Exceptions

In order to facilitate error handling in PL/SQL, Oracle has designed several"built-in" or predefined exceptions. These exceptions are used to handle common situations that may occur on the database. For example, there is a built-in exception that can be used to detect when a statement returns no data, or when a statement expecting one piece of data receives more than one piece of data. There is no invoking a predefined exception - they are tested and raised automatically by Oracle. However, in order to have something done when the predefined error occurs, there must be something in the exception handler both to identify the error and to define what happens when the error occurs. Later, in the section "Identifying Common Exceptions," several of the most common exceptions will be presented.

TIP: In order to trap a predefined exception, there must be an exception handler coded for it in the exceptions section of the PL/SQL block.

User-Defined Exceptions

In addition to predefined exceptions, there can be created a whole host of user-defined exceptions that handle situations that may arise in the code. A user-defined exception may not produce an Oracle error; instead, user-defined exceptions may enforce business rules in situations where an Oracle error would not necessarily occur. Unlike predefined exceptions, which are implicitly raised when the associated error condition arises, a user-defined exception must have explicit code in the PL/SQL block designed to raise it. There is code required for all three sections of a PL/SQL block if the developer plans on using user-defined exceptions. The required code is detailed in the bullets that follow:

  • Exception declaration In the declaration section of the PL/SQL block, the exception name must be declared. This name will be used to invoke, or raise, the exception in the execution section if the conditions of the exception occur.
  • Exception testing In the execution section of the PL/SQL block, there must be code that explicitly tests for the user-defined error condition, which raises the exception if the conditions are met.
  • Exception handling In the exception handler section of the PL/SQL block, there must be a specified when clause that names the exception and the code that should be executed if that exception is raised. Alternately, there should be a when others exception handler that acts as a catchall....

Customer Reviews

Average Review:

Write a Review

and post it to your social network

     

Most Helpful Customer Reviews

See all customer reviews >