I'm trying to use dynamic sql to execute a procedure and retrieve the output parameters:
v_sql := 'BEGIN ' || p_procname || '(''' || p_input1 || ''', ''' || p_input2 || ''', v_output1); END;';
DBMS_OUTPUT.PUT_LINE(v_sql);
EXECUTE IMMEDIATE v_sql;
I have the v_output1
variable declared, but I get this error message:
PLS-00201: identifier 'V_ISSUE' must be declared
The procedure works if I replace the above code with the dbms_ouput from v_sql
, so it's OK on the procedure side, the issue is somewhere in how I'm trying to call it dynamically.
I don't know if what I'm trying to do will work this way. Is there a way to retrieve the output parameters from this procedure call through dynamic SQL?