RelationalDBDesign
SiteMap
PL/SQL
Stored Objects
PL/SQL Programming
Creating Packages
«Prev
PL/SQL Objects
User Defined Functions
Correct Syntax Function
Syntax of Function
Function Returning Value
Function Returning Number
Returning Boolean Value
Function Syntax Returning Boolean
PL/SQL Blocks Conclusion
Create Procedure
Procedure Percentage Average
Procedures Calling Functions
Adding Procedure Function
Create Trigger
What is a trigger?
Trigger Procedure Distinction
Special Trigger Variables
Combination Insert, Update, Delete
Database Triggers Conclusion
Using Parameters
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
Controlling Transactions
Making the Package Body - Exercise
Create a package
Objective:
Combine two procedures and a function into a package
Exercise scoring
This exercise is worth 30 points. You will receive points for correct syntax of the package and for good documentation explaining your use of parameters and variables.
Background/overview
You are working with the House-O-Pets database and have created a procedure and a function. You have decided that it will be more efficient for all of these objects to be stored and used as a package. Your goal is to take the PL/SQL code that creates the procedure and the function and convert it so that it creates a single package that contains both sub-programs. The function should be a private sub-program within the package.
Download files
Download the package_exercise.sql file from the Resources page for the source code of the procedure and functions to be included in your package.
Instructions
Using the downloaded file and your own text editor, create the two commands needed to generate the package specification and package body. Create your
own name for the package,
procedure,
function,
and all parameters.
Document your code by explaining how you used parameters and variables in the package.
Submitting your exercise
Copy the two SQL commands you have created and your explanations for the parameters and variables you used into the text box shown here. Click
Submit
button to see the results to you.
Submit