Why would a package require two procedures or functions with the same name?
What will be an ideal response?
The feature of overloading in packages is the ability to use the same name on multiple program units within the same package. Why would we want to have two procedures or functions with the same name? For example, one part of the Brewbean's application allows a product search to look up a particular product's regular price and sale price. The application screen shows a text box in which the user enters either a product id or name. In this scenario, we want to accomplish the same action (return the product's regular and sale price), but in one case, a number or id is provided as input, and in the other a string or product name is provided as input. When the user clicks the Search button, we want to invoke a procedure that can accept either a numeric or character argument as provided by the user.
How can this be accomplished when a data type must be assigned to a parameter when a procedure is created? The solution is overloading or creating two procedures in a package with the same name, and have the first contain a numeric parameter while the second contains a character parameter. When the procedure is invoked, the system identifies which one of the procedures has parameters that match the input data based on number of parameters and data types. In the Brewbean's example, the system can identify the correct procedure because one of the procedures has a numeric IN parameter while the other has a character IN parameter.
You might also like to view...
MIS can add value to both primary activities and support activities in the value chain. Which of the following is not an example of a company adding value by the use of MIS in a primary activity?
A. Royal Crest Dairy using their custom order and delivery system through an easily accessible Web portal for the customer to track delivery status. B. A system for the sales and marketing departments to track specific sales targets and follow up processes. C. An easy electronic survey, similar to the survey monkey, to be sent to the customer right after a service was completed. D. Scottrade Corp. creating an online system for employees to track paychecks, benefits, wellness rewards program, and other employee benefit items.
Which of the following is not a step in the integrative bargaining process?
A. Create standards for decision making B. Identify issues that need to be discussed C. Present a list of demands to the other party D. Understand each side's fundamental interests
A manufacturer of office furnishings is finding it difficult to compete with cheaper imported merchandise. Which of the following is a potential source of new-product ideas that would allow it to compete more effectively?
A. current retailers who carry the manufacturer's equipment B. its foreign competitors C. the company's employees D. customers who have requested its catalogs E. all of these
1. The strength of any cryptographic system rests with the _________ technique, a term that refers to the means of delivering a key to two parties that wish to exchange data without allowing others to see the key
What will be an ideal response?