For an automated task I would very much like to run some SQL scripts and make sure that sqlplus
does not hang under any circumstancees, i.e.:
- If the script contains any named substitution variable that has to be entered by the user, sqlplus should return with an error instead of prompting for the variable -- I cannot use
set define off
, as some of these scripts need to accept command line parameters that have to be resolved with&1
- The script must not "hang" when it doesn't contain an
exit;
at the end - Anything else: If it would require a prompt, it should return with an error.
How can i do this with Oracle (and sqlplus
or something else)?
set define off
at the start of the script. For more details read the manual. – a_horse_with_no_name Apr 16 at 20:47&name
should generate an error, as there is no user to enter any value, but&1
should work when a parameter is provided. – Martin Apr 17 at 8:11