473,473 Members | 2,163 Online
Bytes | Software Development & Data Engineering Community
Create 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 2674
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.google.c om...
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
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...
2
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...
0
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...
8
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...
5
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...
2
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...
0
by: YellowFin Announcements | last post by:
Whitepaper: "Yellowfin Reporting" enables Embedded Business Intelligence -------------------------------------------------------------------------------- Embedded reports are a standard...
0
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...
3
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 ....'...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.