DB2 Stored Procedures: Here are Top Benefits

In which of the following scenarios would a stored procedure be beneficial?
a)An application running on a remote client needs to be able to convert degrees Celsius to degrees Fahrenheit and vice versa

b)An application running on a remote client needs to collect three input values, perform a calculation using the values provided, and store the input data, along with the results of the calculation in two different base tables.

c) An application running on a remote client needs to track every modification made to a table that contains sensitive data.

d)An application running on a remote client needs to ensure that every new employee that joins the company is assigned a unique, sequential employee number

Answer is B:

The correct answer is B. A scalar user-defined function would be the best option for the requirements outlined in answer A; an UPDATE trigger and a DELETE trigger that inserts records into an activity table every time update and delete operations are performed on a table containing sensitive data would be the best way to accomplish the requirements outlined in answer C; and an identity column or sequence could be used to address the requirements shown in answer D.

Ref: IBM

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.