Some scripts I have inherited will blindly call SET FEEDBACK OFF
or SET ECHO OFF
at the beginning of the script, then set them to ON
or OFF
at the end of the script. I would like to modify these scripts to determine what value was set before the script was run, and set the environment back to that value when the script completes.
How do I query SQL Plus environment values, store them, and restore them when a script has finished?
One method I have thought of:
SPOOL env-backup.sql
SHOW ECHO FEEDBACK TIMING
REM ...
@env-backup.sql
But
- The values
SHOW ECHO FEEDBACK TIMING
spits out can't be executed directly (ECHO OFF
vsSET ECHO OFF
) - I would rather not create yet another file (or any modifications to the DB)
Not that it is necessarily related, but I'm using SqlPlus from Oracle XE (10g) on Windows