Unix Technical Forum

Stored Procedure Options: Modifies SQL Data and Results Set

This is a discussion on Stored Procedure Options: Modifies SQL Data and Results Set within the DB2 forums, part of the Database Server Software category; --> Hi - I would be grateful for any knowledge regarding the following. Whilst QAing Stored Procedures developed by colleagues, ...


Go Back   Unix Technical Forum > Database Server Software > DB2

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 06:41 AM
alex.mcshane@btinternet.com
 
Posts: n/a
Default 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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2008, 06:41 AM
Phil Sherman
 
Posts: n/a
Default Re: Stored Procedure Options: Modifies SQL Data and Results Set



alex.mcshane@btinternet.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
>

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-27-2008, 06:41 AM
Serge Rielau
 
Posts: n/a
Default Re: Stored Procedure Options: Modifies SQL Data and Results Set

Phil Sherman wrote:
>
>
> alex.mcshane@btinternet.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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:10 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com