Lab 5 of 7 : Using Procedures and Functions
A. Lab 5 of 7 : Using Procedures and Functions
B.
Lab Overview – Scenario/Summary:
You have been asked to implement procedure and function calls to perform some arithmetic calculations. Parameters/arguments will be passed into the functions and procedures, and results will be returned.
Upon completing this lab assignment, students would have a better hands-on understanding of how to construct and execute subprograms using procedures and functions within SQL PL.
C. Deliverables:
Lab Steps (all done in power systems) Points
Step 1 Procedure Calls 30 Pts.
Step 2 Function Calls 30 Pts.
Total Lab Points 60 Pts.
D. Lab Steps:
Step 1: Procedure Call
a) You will create two procedures, one of which will call the other. For the purposes of these instructions, we will refer to the calling procedure as the “outer” procedure, and the called procedure as the “inner” procedure, but you should name these items whatever you want in your code.
b) The outer procedure will feed the inner procedure a U.S.-dollar amount and the name of a currency, and the inner procedure will return the equivalent amount of the specified currency, using the conversion rates supplied in the following table:
Currency One type of this currency is worth this many U.S. dollars:
Euro 1.2673
Canadian Dollar 0.893575
Pounds Sterling 1.8655
Mexican Peso 0.0908265
c) You will call the inner procedure/function four times from the outer procedure, passing in the same dollar value (your choice) and a different currency name each time. The outer procedure should use the value received from the conversion procedure/function to populate an OUT variable (you’ll need four separate out variables) with a message of the following form (dynamic content in brackets):
[Date and Time]: $[input dollar amount] USD converts to [converted amount] of [input currency name]
Step 2: Function Call
a) Modify the code in Step 1 such that the inner procedure is now a function. All other aspects of the problem should remain the same.
END OF LAB 5
For Submission into the Week 5 iLab Dropbox:
Zipped file containing:
• SQL PL code for each task
• Screenshots of output from executing each task
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"
![](https://sp-ao.shortpixel.ai/client/to_webp,q_glossy,ret_img,w_320,h_80/http://academicheroes.com/wp-content/uploads/2018/09/order_now.png)