I have a script that will be executed from SQLPLUS.
I need the script to query a table, and assign the result value to a variable. I then need to call a second script with the value of that variable.
Here is a generic non-working example of what I need to do. I need to put a value in the ScriptName variable then execute the script with that name. Is it possible? Passing the value from a bat file or something isn't possible in this situation.
DECLARE ScriptName VARCHAR2(50);
BEGIN
-- Get name of script
SELECT NextScript INTO ScriptName FROM GenericTable;
-- Execute the script
@ScriptName
END;
/