I am dealing with a situation that involves one procedure that calls another procedure which in turn calls another which...you get the idea. The chain is about 5 long. Yes its ugly and I want to rewrite them or consolidate the mess.
This got me to thinking how to better control the "flow" of something like this. So instead of something like this
(call sequence)
A > B > C > D > E
do this instead
start transaction
A > B
...check return code
A > C
...check return code
A > D
...check return code
A > E
...check return code
if return code(s) ok, then return success to caller, otherwise handle error message etc
Thoughts?