Never had any personal experience with it. But looks like its crapping out because it doesnt know some SQL happened before. In other words a bug in it. If this product is not GNU and you bought it, I would raise a case against them.
Stepping through sprocs takes a bit of understanding.
1 The tools out there (commercial, priced, or Open Source) do anywhere from a middling to a horrible job.
2 There is a Sybase proc debugger, but that has only come out recently, and the Tools have not integrated it yet.
3 You always fall back on:
- cut-and-paste code segments from the sproc, into a separate window (based on your tool)
- starting from the inner-most code segment, to the outer-most
- execute those code segments separately, until you obtain success
- then build up those code segments (inner-most to outer-most), maintaining success for the expanding code segment
- until you get to the point where you have finished (you just need to wrap the code segment with a "create proc as", etc. to produce a true proc)
Once you understand this, the error msgs are easy to get around. Just cut-an-paste the cursor declaration plus the fetch into a window in your tool, and execute it. Then add the code within the loop, so you have the declaration, the fetch, and the loop. And so on.