Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2008
    Posts
    1

    Unanswered:

    Hi
    Please let me know, how to debug sybase stored procedure in UNIX environment.
    I appreciates your help.

    Thanks
    Shankar

  2. #2
    Join Date
    Jun 2007
    Location
    London
    Posts
    2,527
    This is what I do:

    Stick the following line after each bit of sql that you want to check.
    Code:
    select 'test a', @@rowcount, getdate()
    The string indicates where it is in the code, you’ll want to change it to something a little more descriptive, the @@rowcount indicates how many rows were effected in the previous sql statement and the getdate() shows the time. Make sure you put this line in each while loop and if-then-else construct. Then run your stored proc using isql, passing the parameters that will test all the paths in your procedure.

    If there’s tonnes of output then send the output to a file. When you’re sure the procedure is fine then remove these lines. You could have a test flag that turns this debugging on so you can initially test things – then you can turn this test output off when the system is running fine – then if someone discovers there’s a bug you can easily turn it back on.
    Mike

Posting Permissions

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