If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > setting debug in SP

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-28-10, 13:14
surjyakp surjyakp is offline
Registered User
 
Join Date: Jan 2010
Posts: 26
setting debug in SP

Hi,
i have written a SP. But now I want to set debug mode on and wants to diaplay those debug messages. e.g. let say before executing a statement in side the SP, i want to siplay some message like "executing insert stmt for table1" and then SQL statement needs to executed.

plz help me on this.

Thanks
Surjya
Reply With Quote
  #2 (permalink)  
Old 01-28-10, 14:40
davebert99 davebert99 is offline
Registered User
 
Join Date: Jun 2009
Location: Pennsylvania
Posts: 21
I create a log table with just a single large VARCHAR column and insert debug records as I need them. I then examine the log table after I run the program.

delete from temp_log_file;
insert into temp_log_file values (varchar(current_timestamp)||' start of debug');
...
...
insert into temp_log_file values (varchar(current_timestamp)||' '||varchar(some_variable)||' before calc' );
commit;
...
insert into temp_log_file values (varchar(current_timestamp)||' '||varchar(some_variable)||' after calc' );
commit;

I always commit after each insert in case the program crashes and does a rollback so I can see where it was.
Reply With Quote
  #3 (permalink)  
Old 01-30-10, 13:14
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
If you have an external routine, you can write to a file. On z/OS, you can write to standard output/standard error and see this output in the WLM output
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On