Home » SQL & PL/SQL » SQL & PL/SQL » sql script (oracle 10g)
sql script [message #408057] Sat, 13 June 2009 07:48 Go to next message
pointers
Messages: 410
Registered: May 2008
Senior Member
Hi,

please give me some idea on the below case.

i have 2 queries.
say,
select * from emp

select * from dept


case 1: i want to create an sql script to run from sql * plus, which creates the two result sets in two seperate excel files
and
case 2: other script two get the two result sets in to one excel files.

Please give me an idea or point to me to a document where i can get the idea for my above two tasks

Regards,
Pointers.
Re: sql script [message #408058 is a reply to message #408057] Sat, 13 June 2009 08:04 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10672
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
case1) Just use separate spool files.
 spool file1.csv
  run 1.sql
  spool off
  spool file2.csv
  run 2.sql
  spool off


case2). Just use spool append .
Append the output of second query to spool file from first query.
http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14357/ch12043.htm#sthref3036
Re: sql script [message #408090 is a reply to message #408057] Sat, 13 June 2009 13:43 Go to previous message
pointers
Messages: 410
Registered: May 2008
Senior Member
thanks for your reply Mahesh.....
i will execute all those given by you.....
--pointers`
Previous Topic: PLS-00222 error
Next Topic: Dynamic Record In PL/SQL
Goto Forum:
  


Current Time: Thu Dec 08 04:01:25 CST 2016

Total time taken to generate the page: 0.24251 seconds