473,803 Members | 4,458 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Stored Procedure Options: Modifies SQL Data and Results Set

Hi - I would be grateful for any knowledge regarding the following.

Whilst QAing Stored Procedures developed by colleagues, I noticed the
following 'superflous' parameter specifications:-

1) "Modifies SQL Data" - where the Stored Procedure is Select only.
In other words, the parameter should have been specified "Reads SQL
Data"

2) Result Sets 'n', where 'n' is > 0 - where the Stored Procedure does
not contain a Cursor.
In other words, the parameter should have been specified "Result Sets
0".

Clearly, the above incorrect parameter specifications still work.

However, can either of them have any adverse impact on Performance,
Concurrency or any other operational attribute?

Thanks

Dec 28 '05 #1
2 2900


al**********@bt internet.com wrote:
Hi - I would be grateful for any knowledge regarding the following.

Whilst QAing Stored Procedures developed by colleagues, I noticed the
following 'superflous' parameter specifications:-

1) "Modifies SQL Data" - where the Stored Procedure is Select only.
In other words, the parameter should have been specified "Reads SQL
Data" You've told UDB that you will be changing table data but aren't. Not a
problem but UDB will allow the procedure to perform updates.
2) Result Sets 'n', where 'n' is > 0 - where the Stored Procedure does
not contain a Cursor.
In other words, the parameter should have been specified "Result Sets
0". This is an estimate of how many result sets will be returned. There is
no requirement to actually have result sets. I'd expect resources to be
allocated to manage the result sets to avoid potential delays when
actually creating them. If you don't use them, then the resources should
be released when the procedure terminates.

Phil Sherman


Clearly, the above incorrect parameter specifications still work.

However, can either of them have any adverse impact on Performance,
Concurrency or any other operational attribute?

Thanks

Dec 28 '05 #2
Phil Sherman wrote:


al**********@bt internet.com wrote:
Hi - I would be grateful for any knowledge regarding the following.

Whilst QAing Stored Procedures developed by colleagues, I noticed the
following 'superflous' parameter specifications:-

1) "Modifies SQL Data" - where the Stored Procedure is Select only.
In other words, the parameter should have been specified "Reads SQL
Data"


You've told UDB that you will be changing table data but aren't. Not a
problem but UDB will allow the procedure to perform updates.

Any procedure created with MODIFIES SQL DATA is notr allowed to be
called in a BEFORE TRIGGER or a READS SQL DATA function.

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
DB2 UDB for Linux, Unix, Windows
IBM Toronto Lab
Dec 28 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
34977
by: Todd Peterson | last post by:
I'm a newbie to DB2 and am trying to figure out how to write a stored procedure, using dynamic SQL statements to return a result set. I believe the majority of the hurdles I have been facing might be due to the fact that the samples and postings I have read have been related to the UDB... I believe our company is on some version of MVS or OS/390, but I am not sure which one, at the time of this posting. I have an example, below, of a...
2
10632
by: Twan Kennis | last post by:
Question: How do I pass a returning resultset from a nested Stored Procedure (which opens a cursor including option "WITH RETURN TO CALLER") as a returning resultset from it's own? When I execute the top-level Stored Procedure, it executes succesfully, but without any resultset. ========================================================== CREATE PROCEDURE sp_executesql(sqltxt CLOB(2M))
2
5464
by: Dino L. | last post by:
How can I run stored procedure (MSSQL) ?
2
11515
by: syntego | last post by:
We commonly use triggers to log changes to our main tables to historical log tables. In the trigger, we create a concatenated string of the old values by casting them as follows: CAST(O.MYDATE AS CHAR(30)) When directly updating date fields in the main table, the logged value gets saved in the format YYYY-MM-DD as expected.
2
2946
by: Roger | last post by:
I have a stored procedure running on DB2 V7 Z/os calling a COBOL program to do some inserts. The stored procedure have 3 input columns and one column is of varchar(32648) The stored procedure is being called from a V7 DB2 connect client. The stored procedure is giving SQL0104N An unexpected token was found if my varchar data goes beyond 1024 bytes. Anything under 1025 bytes on that column is working perfectly. Does anybody know of...
0
1417
by: Roger | last post by:
have a stored procedure running on DB2 V7 Z/os calling a COBOL program to do some inserts. The stored procedure have 3 input columns and one column is of varchar(32648) The stored procedure is being called from a V7 DB2 connect client. The stored procedure is giving SQL0104N An unexpected token was found if my varchar data goes beyond 1024 bytes. Anything under 1025 bytes on that column is working perfectly. Does anybody know of any...
4
3996
by: nishi57 | last post by:
I hope I can get some help regarding this issue, which has been going on for a while. I have a desktop user who is having problem running "Stored Procedures". The DB2 Connect application works fine but when he runs the stored procedure, he gets the following error message. "SYSPROC".CSGCSB54 - Run started. Data returned in result sets is limited to the first 100 rows. Data returned in result set columns is limited to the first 20...
3
6205
by: yinzara | last post by:
I have the following trigger that calls a DB2 stored procedure: DROP TRIGGER GGWU.TRI_A_MULTI_PROP@ CREATE TRIGGER GGWU.TRI_A_MULTI_PROP AFTER INSERT ON GGWU.MULTIPLIER_PROPERTY REFERENCING NEW AS POST FOR EACH ROW MODE DB2SQL BEGIN ATOMIC CALL GGWU.PKG_MULT_PROP_INSERT(POST.C_PROPERTY_CODE,POST.I_MULTIPLIER_ID); END@
0
3192
by: SOI_0152 | last post by:
Hi all! Happy New Year 2008. Il hope it will bring you love and happyness I'm new on this forum. I wrote a stored procedure on mainframe using DB2 7.1.1 and IBM language c. Everything works fine. Now we decided to move from mainframe IMS-DB2 to Windows 2003 server-DB2 UDB for LUW 9.5.
0
9703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10548
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10316
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10295
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9125
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7604
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5629
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2970
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.