I have requirement not only to call a stored procedure dynamically but also to pass the parameters dynamically to that stored procedure.
Arguments are coming from the ALL_ARGUMENTS
table which is Oracle data dictionary table. These arguments are going to vary based on rpt_wrapper_name
.
For example sp1 will look like as below:
sp1 (v1, v2, v3)
Stored procedure sp2
will look like as below:
sp2 (v1, v2, v3, v4, v5)
Stored procedure sp3
will look like this:
sp3 (v1, v2, v3, v4, v5, v6, v7,...)
Currently I am trying a dynamic SQL call, but this is not working for me
EXECUTE IMEDIATE 'BEGIN ' || p_Rpt_wrapper_name|| '(' || p_ParamList || ') ; END;'
Using p_ParamListUsing;
where
p_ParamList := :v1,:v2,:v3
p_ParamListUsing:= v1,v2,v3
Error:
Not All variables as are bound ORA-01008
Parameter list is going to vary based on rpt_wrapper_name
How we can I achieve this? Please help