RelationalDBDesign
SiteMap
PL/SQL
Stored Objects
PL/SQL Programming
Creating Triggers
«Prev
Next»
PL/SQL Objects
User Defined Functions
Correct Syntax Function
Syntax of Function
Stored Function
Function Returning Value
Returning Boolean Value
Function Syntax Returning Boolean
PL/SQL Blocks Conclusion
Create Function
Create Procedure
Oracle Function Procedure
Procedure Percentage Average
Procedures Calling Functions
Adding Procedure Function
Functions Procedures C onclusion
Intro Database Trigger
What is a Trigger?
Trigger Procedure Distinction
Special Trigger Variables
Insert Update Delete
Combination Insert, Update, Delete
Database Triggers Conclusion
Using Parameters
PL/SQL Parameter Uses
Sending Parameters SQL*Plus
PL/SQL Parameter Usage
Parameter Procedure Placement
Return Command Function
PL/SQL Cursor Parameters
SQL*Plus Conclusion
Create Oracle Package
What is a Package?
How Packages are Used
Making Package Specification
Making Package Body
Executing Package Components
Package Conclusion
Controlling Transactions
Creating Trigger Combination - Exercise
Creating a combination insert, update, and delete trigger
Objective:
Create one trigger that combines the three triggers from the previous exercise
Exercise scoring
This exercise is worth 15 points. Once you have completed your answer you will submit it.
Background/overview
This exercise works with the Pet Store schema (our course project) and tests your new skills in using Oracle exclusive operators and conditions and your ability to create a hierarchical query. Now that you have created three triggers for the PET_CARE_LOG table in the previous lesson, you want to combine all three triggers so that they can share the exception handler and other code if possible.
Download files
Download the PETSTORE schema files from the Resources page if you plan to install them into your own database.
Hints
Look at the simulation in this lesson to see how to change the exception handler code so that it can send different messages.
Instructions
Create one trigger that fires whenever an insert, update, or delete occurs on the PET_CARE_LOG. Divide up the body into sections that are executed only when an insert occurs, only when an update occurs, and only when a delete occurs.
Submitting your exercise
Create the code on your computer. Then cut and paste the text of the entire trigger into the text box below. Click the
Submit
button to submit your answers.
Remember that you must submit all your responses to this exercise at once.