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.