User Defined Functions
Syntax of Function
Function Returning Value
Returning Boolean Value
Function Syntax Returning Boolean
PL/SQL Blocks Conclusion
Procedure Percentage Average
Procedures Calling Functions
Adding Procedure Function
What is a trigger?
Trigger Procedure Distinction
Special Trigger Variables
Combination Insert, Update, Delete
Database Triggers Conclusion
Sending Parameters SqlPlus
PL/SQL Parameter Usage
Parameter Procedure Placement
Parameters Return Command Function
PL/SQL Cursor Parameters
Create Oracle Package
What is a Package?
Making Package Specification
Making Package Body
Executing Package Components
Creating Trigger Combination - Exercise
Creating a combination insert, update, and delete trigger
Create one trigger that combines the three triggers from the previous exercise
This exercise is worth 15 points. Once you have completed your answer you will submit it.
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 the PETSTORE schema files from the Resources page if you plan to install them into your own database.
Look at the simulation in this lesson to see how to change the exception handler code so that it can send different messages.
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
button to submit your answers.
Remember that you must submit all your responses to this exercise at once.