This discussion is archived
1 Reply Latest reply: Jun 14, 2012 8:30 AM by Paul M. RSS

Reroute sql output to file?

943352 Newbie
Currently Being Moderated
So I have a .sql script:
select table_name, column_name,count(*) over(partition by table_name) count_column from user_tab_columns

that I can run in SQLDeveloper and it outputs what I want into a "Script output" window below.
I want to be able to run this from a command line and have everything that currently goes to that window go into say log.txt

When I run sqlplus usr/pass@SID <myscript.sql it just logs in and logs out. Not really sure what's happening.

Sorry mods, I found a solution:
SPOOL filename

Edited by: 940349 on Jun 14, 2012 7:07 AM

Edited by: 940349 on Jun 14, 2012 7:24 AM


  • Correct Answers - 10 points
  • Helpful Answers - 5 points