Solved

Set isolation level in db2 luw stored procedure

Posted on 2011-03-23
2
1,011 Views
Last Modified: 2012-05-11
Hi,

We're in the process of converting our sql stored procedures to db2 luw stored procedures.

Is there a way to set the isolation level for the entire stored procedure like in sql - set transaction isolation level read uncommitted?

I know i could just use "with UR" after every join but would just prefer to do this with one statement. Is this possible and where would you place it in a db2 sp? I've attached an example sp. Where would the statement go for this?

Thanks
CREATE PROCEDURE TEMP_PROC1 (IN NAMEA VARCHAR(125))

DYNAMIC RESULT SETS 1
P1: BEGIN

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 NAME = NAMEA;

COMMIT;

BEGIN
DECLARE c2 CURSOR WITH RETURN FOR
SELECT COL1
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
0
 

Author Comment

by:smythsit
Comment Utility
great thanks
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

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 (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

763 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

11 Experts available now in Live!

Get 1:1 Help Now