?
Solved

Set isolation level in db2 luw stored procedure

Posted on 2011-03-23
2
Medium Priority
?
1,045 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
[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: 35198998
0
 

Author Comment

by:smythsit
ID: 35199358
great thanks
0

Featured Post

Basic Security of Your VPC

So, you’ve got this shiny new VPC and a fancy new application configured on your EC2 servers ready to go. This application is only accessible from your computer, which is great for security, but you need your users to be able to access it! So, what’s the easiest way to do this?

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 (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…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

777 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