 |
|
 |
|
Next: Enterprise Replication systems
|
| Author |
Message |
External

Since: May 04, 2004 Posts: 42
|
(Msg. 1) Posted: Sun Sep 05, 2010 5:25 pm
Post subject: Simple debugging of procedures? Archived from groups: comp>databases>ibm-db2 (more info?)
|
|
|
Hello,
Is there a simple way to debug DB2 SQL procedures, such as: which branch
of a conditional construct was chosen, what value did a counter reach,
etc, _without_ installing some big, complicated IDE?
My question could maybe be rephrased as "is there a way to perform printf-
style debugging in DB2 SQL procedures?"
If not: I'm considering creating a C-based UDF which logs arbitrary
strings to syslog, so that a SQL procedure can inform the surroundings of
its state during development.
--
Troels >> Stay informed about: Simple debugging of procedures? |
|
| Back to top |
|
 |  |
External

Since: Sep 05, 2010 Posts: 1
|
(Msg. 2) Posted: Sun Sep 05, 2010 5:25 pm
Post subject: Re: Simple debugging of procedures? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
On Sep 5, 11:17 pm, Troels Arvin wrote:
> Hello,
>
> Is there a simple way to debug DB2 SQL procedures, such as: which branch
> of a conditional construct was chosen, what value did a counter reach,
> etc, _without_ installing some big, complicated IDE?
>
> My question could maybe be rephrased as "is there a way to perform printf-
> style debugging in DB2 SQL procedures?"
>
> If not: I'm considering creating a C-based UDF which logs arbitrary
> strings to syslog, so that a SQL procedure can inform the surroundings of
> its state during development.
>
> --
> Troels
I don't know if Serge's SQL PL/PL/SQL profiler would be of use:
http://www.google.com/url?sa=D&q=https://www.ibm.com/developerworks/my...eloperw
(I hope this link works, otherwise he had posted it a short while
ago.)
What else comes to my mind is a debug table and a debug function,
something like insert into dbg values (current timestamp, message).
PL/SQL should have a debug function built in if you're on V9.7.
Sorry, mainly guesses here. >> Stay informed about: Simple debugging of procedures? |
|
| Back to top |
|
 |  |
External

Since: May 04, 2004 Posts: 42
|
(Msg. 3) Posted: Mon Sep 06, 2010 4:25 am
Post subject: Re: Simple debugging of procedures? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Hello,
Willem Fischer wrote:
> I don't know if Serge's SQL PL/PL/SQL profiler would be of use
[...]
I'm not thinking about performance at this point, but may come in handy
later on.
> What else comes to my mind is a debug table and a debug function,
> something like insert into dbg values (current timestamp, message).
Yes, but can such inserts be done outside of the currently running
transaction? - Otherwise I suppose that no messages will end up in the
message-table?
> PL/SQL should have a debug function built in if you're on V9.7.
That's interesting. I suppose this relates to DBMS_OUTPUT which seems to
be exactly what I was looking for. Thanks.
--
Troels >> Stay informed about: Simple debugging of procedures? |
|
| Back to top |
|
 |  |
External

Since: May 04, 2004 Posts: 42
|
(Msg. 4) Posted: Mon Sep 06, 2010 7:25 am
Post subject: Re: Simple debugging of procedures? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Hello,
I wrote:
>> PL/SQL should have a debug function built in if you're on V9.7.
>
> That's interesting. I suppose this relates to DBMS_OUTPUT which seems to
> be exactly what I was looking for. Thanks.
Hmm. DBMS_OUTPUT requires that Oracle compatibility be enabled
Is Oracle compatibility enabled in all DB2 LUW 9.7 editions, or does it
require a special licence?
--
Troels >> Stay informed about: Simple debugging of procedures? |
|
| Back to top |
|
 |  |
External

Since: Sep 06, 2010 Posts: 1
|
(Msg. 5) Posted: Mon Sep 06, 2010 7:28 am
Post subject: Re: Simple debugging of procedures? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
|
|
| Back to top |
|
 |  |
External

Since: Sep 15, 2003 Posts: 228
|
(Msg. 6) Posted: Tue Sep 07, 2010 12:17 am
Post subject: Re: Simple debugging of procedures? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
On Sep 5, 2:17 pm, Troels Arvin wrote:
> Hello,
>
> Is there a simple way to debug DB2 SQL procedures, such as: which branch
> of a conditional construct was chosen, what value did a counter reach,
> etc, _without_ installing some big, complicated IDE?
One thing you can do is create a global temporary table, and have
your
procedure insert records into the GTT. Then, simply query your GTT
to
see your output... >> Stay informed about: Simple debugging of procedures? |
|
| Back to top |
|
 |  |
| Related Topics: | Stored Procedures error SQL0440N on db2 8.1 fp5 - All, we are trying to create and execute our stored procs on db2 ver 8.1 fp5. This is a new database that we setup and are having some trouble. When I try and run the stored proc from the db2 command line, I get the following error: SQL0440N No..
Running DB2 Stored Procedures from Microsoft SQL Server 2000 - I have looked the newsgroups up and down and can't seem to find any information on this topic so I'm hoping this group can help me. We are a DB2 and SQL Server shop. Most of the time we are using ADO.NET to access DB2 stored procedures in the PC side,....
Declared Global Temporary Table in multiple Stored Procedu.. - Hi, As I understand it, Declared Global Temporary Tables (DGTTs) have a scope that is session/connection based. Using the same connection, I have discovered that if I declare a DGTT in one stored procedure, then I can't create a second stored procedure....
Seeking simple after insert example - I'm using DB2 8.1. Suppose table foo has columns name and lname: create table foo (name as varchar(200), lname as varchar(200)); Write a trigger that inserts the lower case value of name after an insert: So insert (name) into foo values ('Hello..
Parallel SQL (forking) in SQL stored procedures - How would I execute two independent SQL statements in the same stored procedure? I have a business process that requires a number of long- running procedures to be executed. The procedures themselves are not related and can be run simultaneously. The.... |
|
You can post new topics in this forum You can reply to topics in this forum You can edit your posts in this forum You can delete your posts in this forum You can vote in polls in this forum
|
|
|
|
 |
|
|