I am trying to pass a loop the name of the procedure I want to call as I need to call 3 similar procedures in a row.
Lets call them:
- Proc_A
- Proc_B
- Proc_C
They each have 1 input variable and 2 output variables.
Any ideas on what I can change to get this to work?
FOR l_counter in 1..3
LOOP
SELECT PROC_NAME into V_PROC FROM PROC_LIST WHERE PROC_ID = l_counter;
EXECUTE IMMEDIATE 'PROC_DB.' || V_PROC || '(1,V_STEP_ERROR_CODE,V_STEP_MSG)';
COMMIT;
END LOOP;
Line 5 currently fails. (The Execute Immediate) with: "invalid SQL statement"