|
I'm not a great sql person so I normally make a file of the data from the sql statements and then use awk (as sugegsted before) to format how I want it.
I normally put it in a script, a bit like this.
sqlplus -s user/password > a_temp_file <<!
set lin 500
set pages 0
select '~', statement....
....
..;
!
I use the ~ so I can search on it later.
Then with in the same script you can use awk on the a_temp_file to change the format to what you desire. Awk should remove the extra empty spaces.
awk '/~/ {print $1, $2, $3, $4}' a_temp_file > report_file.
You can change the , to <tab> "\t" or any thing else. You can also easily put coloumn names and things like that.
Hope it helps
|