473,412 Members | 2,294 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

Problem with SET_ROUTINE_OPTS()

Hi All;
Am running DB2 LUW v8.2 (FP10) on AIX and having trouble with SQL
stored procedure bind options.

I have run the following code expecting to be able to change the
isolation level for this proc from the default of cursor stability to
repeatable read. I have experimented with placing COMMITS between the
statements and the procedure package is always created with the default
isolation of CS. For the life of me, I cannot get the
set_routine_opts() procedure to work. Help!? (and thanks in advance...)

Pete H
--------------------------------------------------------------------------------------------------------------------------------------------------
call set_routine_opts('ISOLATION RR');
CREATE PROCEDURE "SPPCH"."EDWUTIL_VALID_SYSIDS2" ( )
DYNAMIC RESULT SETS 1
LANGUAGE SQL
READS SQL DATA
BEGIN
DECLARE SQLCODE INTEGER DEFAULT 0 ;

-- use WITH RETURN TO CLIENT in DECLARE CURSOR to always
-- return a result set to the client application
DECLARE c1 CURSOR WITH RETURN TO CALLER FOR
select SYS_ID as value, SYS_DESC as meaning
from dd.SYSTEM
order by sys_id;
-- to return result set, do not CLOSE cursor
OPEN c1;

END;

Jan 15 '07 #1
3 2082
Hi, Pete:

I appreciate that you want to know why the SET_ROUTINE SP isn't working
as you think it should (sorry I can't help you there), but if all else
fails, consider adding WITH RR after your ORDER BY, i.e.,

CREATE PROCEDURE "SPPCH"."EDWUTIL_VALID_SYSIDS2" ( )
DYNAMIC RESULT SETS 1
LANGUAGE SQL
READS SQL DATA
BEGIN
DECLARE SQLCODE INTEGER DEFAULT 0 ;

-- USE WITH RETURN TO CLIENT IN DECLARE CURSOR TO ALWAYS
-- RETURN A RESULT SET TO THE CLIENT APPLICATION
DECLARE C1 CURSOR WITH RETURN TO CALLER FOR
SELECT SYS_ID AS VALUE, SYS_DESC AS MEANING
FROM DD.SYSTEM
ORDER BY SYS_ID
WITH RR;
-- TO RETURN RESULT SET, DO NOT CLOSE CURSOR
OPEN C1;

END;

--Jeff

peteh wrote:
Hi All;
Am running DB2 LUW v8.2 (FP10) on AIX and having trouble with SQL
stored procedure bind options.

I have run the following code expecting to be able to change the
isolation level for this proc from the default of cursor stability to
repeatable read. I have experimented with placing COMMITS between the
statements and the procedure package is always created with the default
isolation of CS. For the life of me, I cannot get the
set_routine_opts() procedure to work. Help!? (and thanks in advance...)

Pete H
--------------------------------------------------------------------------------------------------------------------------------------------------
call set_routine_opts('ISOLATION RR');
CREATE PROCEDURE "SPPCH"."EDWUTIL_VALID_SYSIDS2" ( )
DYNAMIC RESULT SETS 1
LANGUAGE SQL
READS SQL DATA
BEGIN
DECLARE SQLCODE INTEGER DEFAULT 0 ;

-- use WITH RETURN TO CLIENT in DECLARE CURSOR to always
-- return a result set to the client application
DECLARE c1 CURSOR WITH RETURN TO CALLER FOR
select SYS_ID as value, SYS_DESC as meaning
from dd.SYSTEM
order by sys_id;
-- to return result set, do not CLOSE cursor
OPEN c1;

END;
Jan 16 '07 #2
How about this?
------------------------------ Commands Entered
------------------------------
--#SET TERMINATOR !
CALL SET_ROUTINE_OPTS('ISOLATION RR')!
CREATE PROCEDURE TEST (OUT outVALUE INT)
LANGUAGE SQL
BEGIN
SET outVALUE = 1;
END!
------------------------------------------------------------------------------
CALL SET_ROUTINE_OPTS('ISOLATION RR')

Return Status = 0
CREATE PROCEDURE TEST (OUT outVALUE INT)
LANGUAGE SQL
BEGIN
SET outVALUE = 1;
END
DB20000I The SQL command completed successfully.

Jan 16 '07 #3

Tonkuma wrote:
How about this?
------------------------------ Commands Entered
------------------------------
Thanks Tonkuma (and Jeffyzzer);
I can get this to work as long as I use the CLP. I can't find the right
syntax to run the set and create from a Windows (Quest) client and am
still not sure why that is... CLP will get me where I need to go for
now. Thanks!

Pete H

Jan 16 '07 #4

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

Similar topics

0
by: Bruce Davis | last post by:
I'm having a problem on windows (both 2000 and XP) with a multi-threaded tkinter gui application. The problem appears to be a deadlock condition when a child thread pops up a Pmw dialog window in...
11
by: Kostatus | last post by:
I have a virtual function in a base class, which is then overwritten by a function of the same name in a publically derived class. When I call the function using a pointer to the derived class...
0
by: Refky Wahib | last post by:
Hi I need Technical Support I finished a Great project using .Net and SQL Server and .Net Mobile Control My Business case is to implement this Program to accept about 1 Million concurrent...
9
by: Sudesh Sawant | last post by:
Hello, We have an application which communicates using remoting. There is a server which is a Windows Service. The server exposes an object which is a singleton. The client is a Web Application...
117
by: Peter Olcott | last post by:
www.halting-problem.com
28
by: Jon Davis | last post by:
If I have a class with a virtual method, and a child class that overrides the virtual method, and then I create an instance of the child class AS A base class... BaseClass bc = new ChildClass();...
6
by: Ammar | last post by:
Dear All, I'm facing a small problem. I have a portal web site, that contains articles, for each article, the end user can send a comment about the article. The problem is: I the comment length...
16
by: Dany | last post by:
Our web service was working fine until we installed .net Framework 1.1 service pack 1. Uninstalling SP1 is not an option because our largest customer says service packs marked as "critical" by...
2
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was asked by someone else what the autopostback was...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.