473,769 Members | 2,214 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

reporting errors in a separate transaction

In Oracle, I would handle exceptions like this

EXCEPTION
WHEN OTHERS THEN
-- open up an autonomous transaction
-- insert SQLCODE, SQLERRM and stored procedure name into log table
-- commit the autonomous transaction
ROLLBACK;
RAISE;
END;

the idea is that I don't lose teh logged error diagnostics when I
rollback the failed transaction.
Any ideas how to accomplish that in DB2 V8.1 for LUW?

TIA
Nov 12 '05 #1
5 2696
Ford Desperado wrote:
In Oracle, I would handle exceptions like this

EXCEPTION
WHEN OTHERS THEN
-- open up an autonomous transaction
-- insert SQLCODE, SQLERRM and stored procedure name into log table
-- commit the autonomous transaction
ROLLBACK;
RAISE;
END;

the idea is that I don't lose teh logged error diagnostics when I
rollback the failed transaction.
Any ideas how to accomplish that in DB2 V8.1 for LUW?

TIA

You have three options that I can think of:
1. Use a file
2. Use a global temporary table defined a ON ROLLBACK PRESERVE ROWS
(requires V8.2)
3. Use a message queue

Cheers
Serge
Nov 12 '05 #2
"Ford Desperado" <fo************ @yahoo.com> wrote in message
news:e9******** *************** ***@posting.goo gle.com...
In Oracle, I would handle exceptions like this

EXCEPTION
WHEN OTHERS THEN
-- open up an autonomous transaction
-- insert SQLCODE, SQLERRM and stored procedure name into log table
-- commit the autonomous transaction
ROLLBACK;
RAISE;
END;

the idea is that I don't lose teh logged error diagnostics when I
rollback the failed transaction.
Any ideas how to accomplish that in DB2 V8.1 for LUW?

TIA

How about do the ROLLBACK first, then insert SQLCODE, SQLERRM and stored
procedure name into log table, then commit.
Nov 12 '05 #3
> 3. Use a message queue

option 3 seems to be quite convenient, thanks. I've read some docs on
wrapping up calls to MQ Series inside a UDF. Has anyone used that in
practice?

It's such a shame DB2 does not have built in message queues like
Oracle does
Nov 12 '05 #4
> How about do the ROLLBACK first, then insert SQLCODE, SQLERRM and stored
procedure name into log table, then commit.


Good point, but I don't always choose to rollback right away.
Nov 12 '05 #5
Ford Desperado wrote:
3. Use a message queue


option 3 seems to be quite convenient, thanks. I've read some docs on
wrapping up calls to MQ Series inside a UDF. Has anyone used that in
practice?

It's such a shame DB2 does not have built in message queues like
Oracle does


Did you already have a look at the MQ functions?

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
Nov 12 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2457
by: Jonathan | last post by:
We have a production database, but due to the crippling load of some reporting tools, we are looking to have a separate reporting database. Due to it's nature, the reporting database doesn't need to be as up to date as the master, perhaps it could be refreshed every evening? What I wish to know is the best way to go about this. Replicating a whole database seems excessive as there are 7000+ tables and we don't need it so closely...
2
2429
by: Trev | last post by:
SQL Server 2000 BE, Access 2002 FE. I want to write a stored procedure, that will among other things log errors to a table, I want to be able to report a summary of work done and errors to the user and let them decide whether to commit or rollback. I so far foresee a couple of problems. 1. Inside a transaction, I write to the error log table, will I be able to read it back again before commit/rollback?
0
2139
by: doli | last post by:
Hi, I have the following piece of code which iterates through the potential errors: i =0 For Each error_item in myConn.Errors DTSPackageLog.WriteStringToLog myConn.Errors(i).Description DTSPackageLog.WriteStringToLog myConn.Errors(i).NativeError i =i +1 Next
8
2753
by: Woody Splawn | last post by:
I am asking this question here because I asked this question in the Reporting Services Newsgroup and did not get an answer. Does anyone know if Reporting Services is intended to work in a client/Server or Local machine environment? Based on what I have seen my guess is yes but that is a guess. In some materal it talks about it running on a web server but my supposition is that this does not necessarily mean that it would not make for a...
5
692
by: Paul Furman | last post by:
What is the proper way to turn off error reporting? I'm on a shared server so... "Note: Although display_errors may be set at runtime (with ini_set ()), it won't have any affect if the script has fatal errors. This is because the desired runtime action does not get executed." .... has me confused if this will really work. Sorry I'm rusty on this. "To set at runtime, use the error_reporting(). See also the
2
3791
by: Christian Stooker | last post by:
Part one: ====== Hi ! I want to use SQLite database like the FireBird database: with big isolation level. What's that meaning ? I have an application that periodically check some input directory,
0
2269
by: YellowFin Announcements | last post by:
Whitepaper: "Yellowfin Reporting" enables Embedded Business Intelligence -------------------------------------------------------------------------------- Embedded reports are a standard requirement of most applications. But users are increasingly demanding more sophisticated reporting from applications - seeking such features as custom report design, ad hoc report creation and analytics. Developers that want to embed business...
0
910
by: Sol Shapiro | last post by:
I've just run into an issue to which I see no solution (at least not an obvious one!). Details: Access 97 (yes I know it is old, but that is what the client has!) Unbound report with a number of queries. All working fine. Needed to add one more set of values coming in from YET another (though separate) query.
3
2309
by: Brian A | last post by:
I have written some Javascript that works perfectly in Firefox - no errors reported. The dreaded MSIE 6 produces nothing but a long line of 'undefinedundefinedundefinedundefinedundefined ....' Each 'undefined' represents a text node or element I have interted into the DOM. As far as I can see I have declared all variables and asigned values so I just can't see what is wrong. Unfortunately the error reporting in MSIE is very poor indeed....
0
9579
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9422
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9984
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8863
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6662
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5293
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3949
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3556
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2811
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.