This content has been marked as final. Show 1 reply
SQL*Plus wasn't designed for that, but you can do it, using substitution variables.
Have the users run main_script.sql, which looks like this
This will call either one of two other scripts: extra_scripts.sql or goodbye.sql
-- This is main_script.sql ACCEPT run_scripts PROMPT 'Are extra scripts required? default (N):' DEFAULT N @@script1 @@script2 COLUMN new_script_col NEW_VALUE next_script SELECT CASE WHEN '&run_scripts' = 'Y' THEN 'extra_scripts' ELSE 'goodbye' END AS next_script_col FROM dual; @@next_script
Extra scripts.sql can be:
and goodbye.sql can be
-- This is extra_scripts.sql @@script3 @@script4
goodbye.sql can also be empty; it dioesn't actually have to do anything at all, even print a message.
-- This is goodbye.sql PROMPT This concludes the job.