Home » SQL & PL/SQL » SQL & PL/SQL » package athat automatically inserts error code n message
package athat automatically inserts error code n message [message #354572] Mon, 20 October 2008 06:23 Go to next message
rahulsql
Messages: 18
Registered: August 2008
Junior Member
when we are writing procedure or function we use exception block.
in that exception block i want to call one procedure from package named ERROR.EXHANDLE that takes the oracle error code and message as peramters . that package should insert these values into one table called error table .
Re: package athat automatically inserts error code n message [message #354573 is a reply to message #354572] Mon, 20 October 2008 06:28 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
That should not be too hard. Start out with a Proof of Concept and see if/where you get stuck. Show us what you did and we can help you out.
Re: package athat automatically inserts error code n message [message #354574 is a reply to message #354573] Mon, 20 October 2008 06:36 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
I'd also add the caller as a parameter. You are probably interested in where the error came from and not only the error message itself.

MHE
Re: package athat automatically inserts error code n message [message #354576 is a reply to message #354572] Mon, 20 October 2008 06:46 Go to previous messageGo to next message
rajavu1
Messages: 1574
Registered: May 2005
Location: Bangalore , India
Senior Member


I'd also add the error time as a parameter. You are probably interested in the time the error occurred and not only the error message itself. Smile

Thumbs Up
Rajuvan.

Re: package athat automatically inserts error code n message [message #354587 is a reply to message #354576] Mon, 20 October 2008 08:17 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
I would add the linenumber too.
And the possibility to add some free text. Maybe you'd want to store the contents of some variables, etc.
Re: package athat automatically inserts error code n message [message #354662 is a reply to message #354576] Mon, 20 October 2008 12:35 Go to previous messageGo to next message
William Robertson
Messages: 1640
Registered: August 2003
Location: London, UK
Senior Member
rajavu1 wrote on Mon, 20 October 2008 12:46

I'd also add the error time as a parameter. You are probably interested in the time the error occurred and not only the error message itself.

The error logging procedure can probably figure that out itself.

Or just set it as the default for the column and forget about it.
Re: package athat automatically inserts error code n message [message #354663 is a reply to message #354572] Mon, 20 October 2008 12:38 Go to previous messageGo to next message
William Robertson
Messages: 1640
Registered: August 2003
Location: London, UK
Senior Member
rahulsql wrote on Mon, 20 October 2008 12:23
i want to call one procedure from package named ERROR.EXHANDLE that takes the oracle error code and message as peramters . that package should insert these values into one table called error table .

Out of interest, what are you going to use the error code for? I've seen a lot of code that faithfully captures SQLCODE but I've never seen anything use it.
Re: package athat automatically inserts error code n message [message #354887 is a reply to message #354572] Tue, 21 October 2008 16:40 Go to previous messageGo to next message
michael_bialik
Messages: 611
Registered: July 2006
Senior Member
Check AUTONOMOUS TRANSACTION as well.

Michael
Re: package athat automatically inserts error code n message [message #354891 is a reply to message #354572] Tue, 21 October 2008 19:55 Go to previous message
Kevin Meade
Messages: 2101
Registered: December 1999
Location: Connecticut USA
Senior Member
Kevin Meade's blog

Autonomous Transactions: a Poor Mis-Understood Feature

Have fun, Kevin
Previous Topic: Number conversion in oracle
Next Topic: sql append
Goto Forum:
  


Current Time: Sat Dec 10 08:49:06 CST 2016

Total time taken to generate the page: 0.08590 seconds