?
Solved

Set isolation level in db2 luw stored procedure

Posted on 2011-03-24
2
Medium Priority
?
1,425 Views
Last Modified: 2012-05-11
Hi,

I'm new to DB2 and we're just starting to convert our sql stored procedures to db2 luw using the ibm data studio.

I just want to make sure i have the "set current isolation ur" satement in the correct place.

I can't seem to put the statement above the variable declaration. Would you know why this is?

Also, with the isolation statement placed here, is the whole stored procedure set to use read uncommitted?

The test stored procedure is below.

Thanks.
CREATE PROCEDURE TEMP_PROC1 (IN NAMEA VARCHAR(125))
DYNAMIC RESULT SETS 1
P1: BEGIN

DECLARE currentDEPT varchar(10);
SET currentDEPT = 'Test';

SET CURRENT ISOLATION UR;

DECLARE GLOBAL TEMPORARY TABLE SESSION.TEMP_TABLE
(COL1   VARCHAR(125)
) ON COMMIT PRESERVE ROWS NOT LOGGED WITH REPLACE;

INSERT INTO SESSION.TEMP_TABLE
SELECT NAME
FROM SYSIBM.SYSTABLES
WHERE CREATOR = NAMEA;

COMMIT;

BEGIN
DECLARE c2 CURSOR WITH RETURN FOR


SELECT COL1, currentDEPT
FROM SESSION.TEMP_TABLE;

OPEN c2;
END;
END P1

Open in new window

0
Comment
Question by:smythsit
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 37

Accepted Solution

by:
momi_sabag earned 2000 total points
ID: 35205922
Hi

just that you would know, insert statement can't run with isolation UR, so db2 will use some other isolation for that statement, besides that, i would put that statement again after the commit, just in case it reset it
0
 

Author Comment

by:smythsit
ID: 35208310
Great thanks a lot.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question