Saving current env in sqlplus scripts
In my sqlplus (version 10.2.0.3) scripts I want to save the current environment (ie, SETs, ALTER SESSIONs altered values, COLUMNs, BREAKs and COMPUTEs) before the execution of the scripts (because some scripts need to change it), and restore exactly then env after the execution : today I´m doing the SETs saving with a :
STORE set sqlplus_settings.sql REPLACE
in the beginning of the script, and a :
in the end - what would be your suggestions for the rest of the points ??
Myself, I was thinking about of :
but the generated .sql file contains line breaks in the commands - I could to use something foreign to sqlplus to eliminate the breaks, but I prefer work in sqlplus, only. And I can´t use UTL_FILE (PL/SQL) for it, because the scripts can be running in the server OR in a client machine. Any suggestions are welcome...
Sorry Davey, your answer doesn’t cut it : in the link Steve just do a CLEAR BREAKS before and after, and store set just save the SETs , so it is LOSTING the BREAK anterior status , my target is different, : as I said want to SAVE the contents of BREAK and COLUMN, and COMPUTE), then clear it, alter it, and later, AFTER the execution of the script, set the BREAKs contents to EXACTLY whatever it was..... The script you pointed does NOT ....
Besides any clever lateral-programming in sqlplus , the only way I see it really save BREAK command output to fle with SPOOL, as I said, but I really don´t know how to xcut the extra line breaks on it.
Click Here to Expand Forum to Full Width