Solved

Set isolation level in db2 luw stored procedure

Posted on 2011-03-23
2
1,022 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 500 total points
ID: 35198998
0
 

Author Comment

by:smythsit
ID: 35199358
great thanks
0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Wrong record extracting - DB2 SQL 10 177
DB2 V8.02 and Oracle security audit information 12 294
Call a stored proc from a VIEW 5 102
iSeries DB2 SQL - Request user input 12 82
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

730 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