'Variable number of bind variables in EXECUTE IMMEDIATE statement

in Oracle, is it possible to have a dynamic number of bind variables in a EXECUTE IMMEDIATE dynamic SQL?

For example, in a given situation i might want to do something like:

execute immediate stmt using lv_name;

But, assuming that stmt is some string that i fetch from some configuration table, one day i might add an additional parameter and would have to recompile the PL/SQL unit to add another parameter, like:

execute immediate stmt using lv_name, lv_age;

...

is it possible in some way to do something like

execute immediate stmt using array_params[] ?

where array params is an array or some sort of structure in PL/SQL that i can handle dynamically? Or receive as a varchar2 parameter and split in some way into an array of tokens?

Thanks!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source