I have a directory full of PLSQL scripts that I want to run, the problem is that the content of that directory is dynamic, and I have no way to know what the names of those scripts will be.
I have to write some stuff to run all of the sql files in that directory, but I can't find a way in PLSQL of call a script which file name is unknown until runtime.
I tried some stuff like load the .sql file content into a VARCHAR2 and then do
EXECUTE IMMEDIATE l_Script_Content;
But for some reason this just doesn't work, I guess there has to be a easier way to do that, like suddenly @ command accepting varchar2 instead a full path.
Can anyone point me in the right direction? Maybe running the scripts from java?
Thanks!