1

I have a test procedure:

CREATE PROCEDURE bfmsp_testproc(@test CHAR(32) = NULL)
AS
BEGIN
  IF @test IS NULL
    RETURN

  IF @test = 'BadReturnCode'
    RETURN 1

  /* Bad test, should probably do something */
  PRINT 'Invalid test code'
  RETURN 1
END

However, I cannot get the return code when I run it in Toad for Sybase.

bfmsp_testproc

bfmsp_testproc 'invalid'

bfmsp_testproc 'BadReturnCode'

There are no results sets (obviously). I see the PRINT output in the Messages tab of the results. However, I cannot find the return code anywhere in the output. The return code is available in my application code, so I know it is coming from Sybase OK.

Ideas? Is there a setting somewhere I am missing to show this? Or does Toad lack this feature?

1 Answer 1

4

I'm assuming you're using Adaptive Server 12.5 or greater.

DECLARE @ret_val INT
EXECUTE @ret_val=bfmsp_testproc 'BadReturnCode'
SELECT @ret_val 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.