I need to use dynamic SQL execution on oracle where I do not know the exact number of bind variables used in the SQL before runtime.
Is there a way to use a variable number of bind-arguments in the call to EXECUTE IMMEDIATE somehow?
More specifically, I need to pass one parameter into the unknown SQL but I do not know how often it will be used there.
I tried something like
EXECUTE IMMEDIATE 'SELECT SYSDATE FROM DUAL WHERE :var = :var' USING 1;
but it threw back with ORA-01008: not all variables bound.