?
Solved

Set isolation level in db2 luw stored procedure

Posted on 2011-03-23
2
Medium Priority
?
1,061 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

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

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…
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…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

650 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