I want SQL query output into excel
I am using Oracle 8i, I want SQL query output into excel. Query is
Select partno, partname,uob from partmast
I want all record from this query are display into excel sheet how it will be possible. (uob is unit of measure) I solve this query by using spool but query result written into the text file but i want into excel. Give me soln for this
Arvind
Re: I want SQL query output into excel
U can't do that directly from SQL*PLUS
try to use any third party tool
or
by using any frontend application.
Re: I want SQL query output into excel
Hi
You can do it using spool command. you need to spool the query output to a [B]csv[/B] file.
and you need to modify ur query so that all the column values are separated my comma. Let me give you an example,
select emp_id || ',' || emp_name ||',' || hire_date from emp;
this query will return you only one column with values like
12,james,01-jan-2005
13,ravi,01-jun-2005
Please go thru this link for further assistance
[url]http://www.oracledbaexpert.com/oracle/ocp/SQLPlusFormatting.html[/url]
Hope this helps you
Re: I want SQL query output into excel
James, how to insert all the records into csv file using cursors?
Re: I want SQL query output into excel
The same can be done using third party tool
Re: I want SQL query output into excel
[QUOTE=arvi.sardar;14463]I am using Oracle 8i, I want SQL query output into excel. Query is
Select partno, partname,uob from partmast
I want all record from this query are display into excel sheet how it will be possible. (uob is unit of measure) I solve this query by using spool but query result written into the text file but i want into excel. Give me soln for this
Arvind[/QUOTE]
Dear ARVI,
Good Morning
Try these steps:
1) Spool test.txt
Select * from CMSLOANISSUETRANSACTION;
Spool off;
2) Open MS-Excel
3) Open the test.txt file in Excel.
4) A wizard will be opened with two options
Specify from where to start, i mean, specify row number in the option[COLOR="Red"] Start import at row[/COLOR] and click next.
5) Use the break line as required and click finish.
I hope this will help you.
Have a pleasant time.
Re: I want SQL query output into excel
Dear ARVI,
Good Morning
Try these steps:
1) Spool test.txt
Select partno, partname,uob from partmast
Spool off;
2) Open MS-Excel
3) Open the test.txt file in Excel.
4) A wizard will be opened with two options
Specify from where to start, i mean, specify row number in the option[COLOR="Red"] Start import at row[/COLOR] and click next.
5) Use the break line as required and click finish.
I hope this will help you.
Have a pleasant time.