Solved

Set isolation level in db2 luw stored procedure

Posted on 2011-03-24
2
1,324 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
2 Comments
 
LVL 37

Accepted Solution

by:
momi_sabag earned 500 total points
Comment Utility
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
Comment Utility
Great thanks a lot.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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 video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

762 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now