469,327 Members | 1,242 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,327 developers. It's quick & easy.

Stored Proc' Offending Line Number in error message?

Hi guys,

when we run a stored proc and it results into an unhandled error, the
error message returned by db2 udb does not contain a line number that
caused an error. This makes it pretty difficult to debug those procs.

Line number have always been there in Oracle messages. When I Googled
on this, I saw some people showing DB2 Stored Proc error messages with
line numbers in them (like LINE NUMBER=1285), which makes me believe
that there should be some sort of option to turn inclusion of line
numbers on.

How do I do that?

DB21085I Instance "dbidev02" uses "64" bits and DB2 code release
"SQL08021"
with level identifier "03020106".
Informational tokens are "DB2 v8.1.1.80", "special_13823",
"U800400_13823", and
FixPak "8".

Thanks for your help
Bogdan

Nov 16 '05 #1
9 2508
A stored PROCEDURE can be compiled with debug information and then run
in debug mode. The DB2 Tools includes Development Center which can
handle this for you.

B.

Nov 16 '05 #2
Thank you Brian. Is there an API of some sort I could use to switch to
debug mode and back programmatically?

Nov 17 '05 #3
I have no idea. The documentation "Application Development Guide:
Programming Server Applications" in Chapter 2 "Developing Routines",
Section "Debugging Routines" says to use the development center.

Watching the code in the center though, it is definitely doing
something. Perhaps someone else can shed some light on the process.

B.

Nov 17 '05 #4
In article <11**********************@g14g2000cwa.googlegroups .com>,
Brian Tkatch (Ma***********@ThePentagon.com) says...
I have no idea. The documentation "Application Development Guide:
Programming Server Applications" in Chapter 2 "Developing Routines",
Section "Debugging Routines" says to use the development center.

Watching the code in the center though, it is definitely doing
something. Perhaps someone else can shed some light on the process.

B.


There are some articles about debugging at the developers work site.
Serge has written one of them, check the (wrapped) link:
http://www-128.ibm.com/developerwork...echarticle/dm-
0409rielau/
Nov 17 '05 #5
kangaroo wrote:
Hi guys,

when we run a stored proc and it results into an unhandled error, the
error message returned by db2 udb does not contain a line number that
caused an error. This makes it pretty difficult to debug those procs.

Line number have always been there in Oracle messages. When I Googled
on this, I saw some people showing DB2 Stored Proc error messages with
line numbers in them (like LINE NUMBER=1285), which makes me believe
that there should be some sort of option to turn inclusion of line
numbers on.

Thsi line-number is maintained by the CREATE PROCEDURE statement.
It is served fro errors in this statement only.
The line-number is passed back through the SQLCA (one of those
overloaded fields. Easy to find when you use UPDATE COMMAND OPTIONS
USING A ON in CLP.
Either way to get line-numbers at runtime use the trace capability
pointed to by Gert. It works on great. :-)

Cheers
Serge

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 18 '05 #6
Brian Tkatch wrote:
I have no idea. The documentation "Application Development Guide:
Programming Server Applications" in Chapter 2 "Developing Routines",
Section "Debugging Routines" says to use the development center.

Watching the code in the center though, it is definitely doing
something. Perhaps someone else can shed some light on the process.

B.

To debug a procedure you need to build it in debug mod.
I don't know the API, and unless you are writing a debugger youself it's
a useless peice of knowledge. ;-)
By contrast the tracer works on a procedure as is.
You can look up the C API (if interested) in teh source code of the my
developer works article.

Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 18 '05 #7
Can you provide a link to that article?

Patrick

Nov 18 '05 #8
Patrick wrote:
Can you provide a link to that article?

Patrick

I am blessed with a rare (make that unique AFAIK) name. Easy to google.
Anyway:
http://www-128.ibm.com/developerwork...dm-0409rielau/

Cheers
Serge

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 19 '05 #9
Patrick wrote:
Can you provide a link to that article?

Patrick


On top of Serge reply - link was already provided *EXACTLY* 2 posts before!

I could understand the agony in tiresome opening Google search bar or page, but
not checking previous reply two lines above must be something very special.

Jan M. Nelken
Nov 19 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Jeff Wang | last post: by
11 posts views Thread by ColdCanuck | last post: by
2 posts views Thread by Kent Lewandowski | last post: by
4 posts views Thread by Pakna | last post: by
2 posts views Thread by myt | last post: by
reply views Thread by mirandacascade | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by listenups61195 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.