I use a script (see below) to place SQLPLUS output into a flat file (see below).
I also use the >/dev/null redirection to suppress an output from SQLPLUS to the stdout.
It works OK.
But now I want to execute another SQLPLUS statement (in the same script file) and I need to send that new output to STDOUT so it could be displayed to the user.
So how can I redirect the output from from /dev/null back to stdout in the same script file?
My simplified script is below. I want max(mynumber) be displayed by STDOUT.
Is that possible? Thank you.
sqlplus -s /nolog > /dev/null 2>&1 <<EOF
set echo off
set feedback off
set linesize 500
set pagesize 0
set sqlprompt ''
set term off
set verify off
set trimspool on
select * from my_table;
select max(mynumber) from my_table;