Is there a way of achieving this? Thanks.
ACCEPT run_scripts PROMPT 'Are extra scripts required? default (N):' DEFAULT N @@script1 @@script2 BEGIN IF &&run_scripts = 'Y' THEN @@script3 @@script4 END IF; END; /
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
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.