Steps in creating oracle non-predefined exception handlers

Assignment Help Database Management System
Reference no: EM131066620

Q1. Explain the steps in creating Oracle non-predefined exception handlers and user defined exception handlers.

Q2. Respond to the following;

Cite References

Oracle non-predefined exception handlers allow exception handling for Oracle numbered errors that do not have predefined exceptions. This requires associating the error number with a user developed exception. This is accomplished by declaring the exception, then using a pragma statement to tie the declared exception to a desired Oracle number (Casteel, 2013, p. 149-150). For example:

Declare exception: ex_name_condition EXCEPTION;

Pragma statement: PRAGMA EXCEPTION_INIT(ex_name_condition, oracleNumber);

At this point, the exception portion of the PL/SQL block is executed when the Oracle error number is encountered.

A user defined exceptions allow developers to enforce business rules. These type of exceptions will not generate predefined exceptions or errors, so they must be developed to execute under certain circumstances (Casteel, 2013, p. 151-152). This is accomplished by declaring the exception, then executing the exception with the RAISE statement when a certain condition is met. For example:

Declare exception: ex_name_condition EXCEPTION;

IF condition THEN RAISE ex_name_condition;

At this point, the exception portion of the PL/SQL block executes the user defined statement or action.

References

Casteel, J. (2013). Oracle 11g: PL/SQL Programming. Boston, MA: Course Technology.

Q3. Respond to the following;

Cite References

Oracle provides some pre-defined exceptions which are names associated with some common errors that are encountered.

Non-predefined exceptions

If we receive an Oracle error that doesn't have a pre-defined exception we may need to create and exception for it and associate it with the Oracle error code. To do this we need to do the following:

DECLARE

Declare the exception name

Associate an Oracle error number with the exception name using the PRAGMA statement

BEGIN

Contains the error sequence

EXCEPTION

Exception handler runs if the sequence declared in BEGIN raises the error code contained in DECLARE

User-defined exceptions

A user-defined error is an error we manually create to handle what we perceive to be an error in the system. For example if no rows were updated after running some code. User defined errors are set up in the following format:

DECLARE

Declare the exception giving it a name

BEGIN

Contains the error sequence that we perceive as incorrect e.g if no rows are updated

EXCEPTION

Exception handler runs if the sequence declared in BEGIN raises the error code contained in DECLARE

Reference

Casteel, J. (2013). Oracle 11g: PL/SQL Programming, 2nd Edition. [VitalSource Bookshelf Online].

Q4. Answer the questions and be sure to cite work

What are the differences between anonymous PL/SQL code and procedures (Oracle named blocks)?

Reference no: EM131066620

Questions Cloud

Semi-annual interest payment : Record issuance of the bonds on June 30, 2016, the payment of interest at December 31, 2016, and the semi-annual interest payment on June 30 2017
The standard deviation for this sample group : A machine dispenses a liquid drug into bottles in such a way that the standard deviation of the contents is 81 milliliters. A new machine is tested on a sample of 24 containers and the standard deviation for this sample group is found to be 26 mil..
How they perceive the value of the training : You are interested in your employee's opinion of a training class. Specifically, you want to know if their experience level is a factor in how they perceive the value of the training. What are the null and alternate hypotheses?
How many sophomores are in the class : How many sophomores are in the class?
Steps in creating oracle non-predefined exception handlers : What are the differences between anonymous PL/SQL code and procedures (Oracle named blocks)? Explain the steps in creating Oracle non-predefined exception handlers and user defined exception handlers.
Airline claims that the no-show rate for passengers : An airline claims that the no-show rate for passengers is less than 5%. In a sample of 420 randomly selected reservations, 19 were no-shows. Use the z-test for proportions and test the airline's claim. Use a = 0.01. Solution:
Complete a rough draft for the market research : You are to complete a rough draft for the "Market Research" in the GE Project (from the syllabus). Additionally, in your post, please also discuss who your main competitor is and why.
Effects of the insecticide ddt on wild birds : Assume that an ecologist is studying the effects of the insecticide DDT on wild birds in Sumatra. DDT sprayed on insects and vegetation subsequently eaten by female birds seems to affect the thickness of their eggshells and thus affects the protec..
Amount of baldwin cash flow from assets : During the year, the firm issued $45,000 in net new equity and paid off $16,000 in long-term debt. What is the amount of Baldwin's cash flow from assets?

Reviews

Write a Review

Database Management System Questions & Answers

  Develop a domain model for the case study

The objective of the assignment is to apply and consolidate skills acquired in the requirement and analysis disciplines through analysis of a simple case study, and to express the results through the relevant UML diagrams.

  Prepare a 700 word paper discussing the case and

prepare a 700 word paper discussing the case and incorporating answers to the questions below. it is important to

  Display all data from each of the tables in the moremovies

Within SQL*Plus, list names of the tables that you have created whose name starts with MM (Hint: use data dictionary view USER_TABLES)

  Create a data dictionary for a simple database

Create a data dictionary for a simple database. Develop an ER diagram. Clearly label all entities, primary and foreign keys, relationship, connectivity and cardinalities.

  Determine columns that make up the primary key

Carry out the following tasks below by using the correct SQL statements. Create the statements in Oracle by using the following steps (SQL > SQL commands > Enter Command). Determine the columns that make up the primary key of the l_lunch_items tabl..

  Database and programming design

Database and Programming Design

  Database design proposal product in the final phase of the

in the final phase of the database design proposal assignment you are required to design a working prototype of the

  Discuss the issues the project manager must consider

Discuss the issues the project manager must consider when assigning programming tasks to programmers.

  Implementation of information gathering component

Based on the pseudocode developed in Subtask 1.1, you are to implement the Information Gathering Component in this task.

  1identify and discuss the serious data redundancy problems

1.identify and discuss the serious data redundancy problems exhibited by the file structure shown in figure.2.looking

  Stores a logically related database over two or more

A distributed database management system (DDBMS) stores a logically related database over two or more physically distinct locations connected by a computer network.

  Consider a video game store for each game the

consider a video game store. for each game the databasenbspcontains information aboutnbsptitle producing company name

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd