Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2010
    Posts
    26

    Unanswered: 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

  2. #2
    Join Date
    Jun 2009
    Location
    Pennsylvania
    Posts
    22
    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.

  3. #3
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •