Re: sqlplus and feedback

From: De DBA <dedba_at_tpg.com.au>
Date: Fri, 10 Jan 2014 09:49:38 +1000
Message-ID: <52CF3592.1040903_at_tpg.com.au>



Hi Remigiusz,

If shell commands are acceptable, then you could use something like this to redirect the rows feedback to STDERR, while you spool the output to a file:

$ sp -s / <<EOF |awk '/rows/ { print $0 > "/dev/stderr" ; } { print $0; } ' >/my/output.txt

 > select * from user_objects;
 > exit
 > EOF

100 rows selected.

Of course, you can change the regular expression /rows/ to catch any output that you don't want to end up in the output file.

Cheers,
Tony

On 08/01/14 20:55, Remigiusz Sokolowski wrote:
> Hi!
> I wonder if is there a way to have an apple and eat it, i.e.
> get the display of rows (which is done by feedback on) and yet suppress this very line in the spooled log (which is intended to be a generated script).
>
> Of course I may do it with earlier select count(*) (which however means the db work x2) or count the log lines (as I spool here) with some shell command (which is acceptable, but not necessarily a very beautiful solution)
>
> Best regards
> Remigiusz
>

--
http://www.freelists.org/webpage/oracle-l
Received on Fri Jan 10 2014 - 00:49:38 CET

Original text of this message