I am calling some SP's inside a parent SP, but the call for child SP's is dynamic.
I select the name and the variables from a table for the call, join them together in a variable called STATEMENT, which is like this
(proc_glove_1 @supp_code, @work_code, @r_code output, @reason output, @result output with recompile),
and then put that variable in a sp call.
EXECUTE (@statement)
But for some reason sybase server returns an error
Error: Incorrect syntax near '@supp_code'., Batch 1 Line 1
(supp_code is the first variable in the call)
Now if i copy the same call at the same place and try to run like this, (
EXECUTE sp_ proc_auth_glove_1 @supp_code, @work_code, @r_code output, @reason output, @result output with recompile), it works.
Now is there any way that i can do this using that first call i-e Dynamically.
Thanx
I select the name and the variables from a table for the call, join them together in a variable called STATEMENT, which is like this
(proc_glove_1 @supp_code, @work_code, @r_code output, @reason output, @result output with recompile),
and then put that variable in a sp call.
EXECUTE (@statement)
But for some reason sybase server returns an error
Error: Incorrect syntax near '@supp_code'., Batch 1 Line 1
(supp_code is the first variable in the call)
Now if i copy the same call at the same place and try to run like this, (
EXECUTE sp_ proc_auth_glove_1 @supp_code, @work_code, @r_code output, @reason output, @result output with recompile), it works.
Now is there any way that i can do this using that first call i-e Dynamically.
Thanx