---
title: "DB2 Stored Procedures: Here are Top Benefits"
description: "Here are stored procedures benefits explain in the context of DB2"
url: https://srinimf.com/2015/10/07/how-db2-stored-procedure-is-beneficial-in-the-below-scenario/
date: 2015-10-07
modified: 2026-10-10
author: "Srini"
image: https://i0.wp.com/srinimf.com/wp-content/uploads/2015/10/pexels-photo-6373290.jpeg?fit=1880%2C1253&ssl=1
categories: ["DB2", "ZOS"]
tags: ["DB2 Stored procedure"]
type: post
lang: en
---

# DB2 Stored Procedures: Here are Top Benefits

**In which of the following scenarios would a [stored procedure](https://srinimf.com/2011/01/15/db2-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

Related[How to describe Data consistency in better way](https://srinimf.com/2016/09/29/how-to-describe-data-consistency-in-better-way/)

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.

Related[Here’s the Oracle Scheduler Job Example](https://srinimf.com/2022/05/21/heres-the-oracle-scheduler-job-example/)

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](https://srinimf.com/2016/01/25/db2-in-cursor-with-multi-record-fetching/) 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*

### Share this:

-
- [Tweet](https://twitter.com/share)
- [![](https://i0.wp.com/assets.pinterest.com/images/pidgets/pinit_fg_en_rect_gray_20.png)](https://www.pinterest.com/pin/create/link/?url=https%3A%2F%2Fsrinimf.com%2F2015%2F10%2F07%2Fhow-db2-stored-procedure-is-beneficial-in-the-below-scenario%2F&media=https%3A%2F%2Fi0.wp.com%2Fsrinimf.com%2Fwp-content%2Fuploads%2F2015%2F10%2Fpexels-photo-6373290.jpeg%3Ffit%3D1200%252C800%26ssl%3D1&description=DB2%20Stored%20Procedures%3A%20Here%20are%20Top%20Benefits)
-
- [Share on Tumblr](https://www.tumblr.com/share)
- [Share on WhatsApp (Opens in new window) WhatsApp](https://srinimf.com/2015/10/07/how-db2-stored-procedure-is-beneficial-in-the-below-scenario/?share=jetpack-whatsapp)
- [More](#)
-

- [Print (Opens in new window) Print](https://srinimf.com/2015/10/07/how-db2-stored-procedure-is-beneficial-in-the-below-scenario/?share=print)
- [Share on Reddit (Opens in new window) Reddit](https://srinimf.com/2015/10/07/how-db2-stored-procedure-is-beneficial-in-the-below-scenario/?share=reddit)
- [Share on Telegram (Opens in new window) Telegram](https://srinimf.com/2015/10/07/how-db2-stored-procedure-is-beneficial-in-the-below-scenario/?share=telegram)
- [Email a link to a friend (Opens in new window) Email](mailto:?subject=%5BShared%20Post%5D%20DB2%20Stored%20Procedures%3A%20Here%20are%20Top%20Benefits&body=https%3A%2F%2Fsrinimf.com%2F2015%2F10%2F07%2Fhow-db2-stored-procedure-is-beneficial-in-the-below-scenario%2F&share=email)
-

### Like this:

Like Loading…
