Results 1 to 7 of 7

Thread: I want SQL query output into excel

  1. #1
    Junior Member
    Join Date
    Jan 2007
    Answers
    1

    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


  2. #2
    Moderator
    Join Date
    Jun 2007
    Answers
    2,074

    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.


  3. #3
    Expert Member
    Join Date
    Jun 2006
    Answers
    410

    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 csv 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
    http://www.oracledbaexpert.com/oracl...ormatting.html

    Hope this helps you


  4. #4
    Junior Member
    Join Date
    Jun 2007
    Answers
    5

    Re: I want SQL query output into excel

    James, how to insert all the records into csv file using cursors?


  5. #5
    Junior Member
    Join Date
    Jun 2007
    Answers
    8

    Re: I want SQL query output into excel

    The same can be done using third party tool


  6. #6
    Contributing Member
    Join Date
    Nov 2007
    Answers
    53

    Re: I want SQL query output into excel

    Quote Originally Posted by arvi.sardar View Post
    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
    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 Start import at row and click next.
    5) Use the break line as required and click finish.

    I hope this will help you.

    Have a pleasant time.


  7. #7
    Contributing Member
    Join Date
    Nov 2007
    Answers
    53

    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 Start import at row and click next.
    5) Use the break line as required and click finish.

    I hope this will help you.

    Have a pleasant time.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact