load query result in ms-excel sheet [message #567297] |
Wed, 26 September 2012 05:58 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](//www.gravatar.com/avatar/0d8d54604424af68f3c669fe2bc54c02?s=64&d=mm&r=g) |
neetesh87
Messages: 280 Registered: September 2011 Location: bhopal
|
Senior Member |
|
|
hello experts,
i have tried it , but it load the data in text file , but i want to load this data in excel sheet
in such a way that each column should be in different-2 cell of excel sheet.
SQL> spool on
SQL> spool 'd:\data.text'
SQL> select * from scott.emp;
EMPNO ENAME JOB MGR HIREDATE SAL COMM D
EPTNO
---------- ---------- --------- ---------- --------- ---------- ---------- -----
-----
7369 SMITH CLERK 7902 17-DEC-80 800
20
7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300
30
7521 WARD SALESMAN 7698 22-FEB-81 1250 500
30
7566 JONES MANAGER 7839 02-APR-81 2975
20
7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400
30
7698 BLAKE MANAGER 7839 01-MAY-81 2850
30
7782 CLARK MANAGER 7839 09-JUN-81 2450
10
7788 SCOTT ANALYST 7566 19-APR-87 3000
20
7839 KING PRESIDENT 17-NOV-81 5000
10
7844 TURNER SALESMAN 7698 08-SEP-81 1500 0
30
7876 ADAMS CLERK 7788 23-MAY-87 1100
20
EMPNO ENAME JOB MGR HIREDATE SAL COMM D
EPTNO
---------- ---------- --------- ---------- --------- ---------- ---------- -----
-----
7900 JAMES CLERK 7698 03-DEC-81 950
30
7902 FORD ANALYST 7566 03-DEC-81 3000
20
7934 MILLER CLERK 7782 23-JAN-82 1300
10
14 rows selected.
SQL> spool off;
SQL>
please tell me how to do this.
thanks in advance.......
|
|
|
|
|
|
Re: load query result in ms-excel sheet [message #567314 is a reply to message #567308] |
Wed, 26 September 2012 08:15 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](/forum/images/custom_avatars/102589.gif) |
Michel Cadot
Messages: 68733 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
set colsep ';'
set ...
spool ...csv
select ...
spool off
Then when you are inside Excel, Data->Convert and follow the screens (in excel 2003, search for excel 2007, this has nothing to do with Oracle).
Regards
Michel
|
|
|