DBAsupport.com Forums - Powered by vBulletin
Results 1 to 7 of 7

Thread: how to dump a query result into a spraed sheet?????

  1. #1
    Join Date
    Jun 2003
    Location
    australia
    Posts
    74

    how to dump a query result into a spraed sheet?????

    Hi all

    Is there any way we can dump the result of sql query(on oracle) into a spread sheet?????

    for example::

    select eno, ename, job, dept, mgr from emp;

    and the query fetches say about 100000 records and the width of a paper is not enough as the result is more than twice of a A4 size paper. So i want spool the extract into a spreadsheet.

    Any help would be greatly appreciated.

    raj
    rajorcl

  2. #2
    Join Date
    Jun 2000
    Posts
    295
    why not set ODBC data source and use MS excel to get
    your data directly?

  3. #3
    Join Date
    Jun 2003
    Location
    australia
    Posts
    74
    Nice but I dont wanna use ODBC, then what???????
    rajorcl

  4. #4
    Join Date
    Feb 2001
    Posts
    125
    hi.

    Spool the result into a text file and open it into excel.


    Soni

  5. #5
    Join Date
    Nov 2002
    Location
    New Delhi, INDIA
    Posts
    1,796
    Do

    spool out.csv
    select empno||','|| ename||','|| job||','|| deptno||','|| mgr from emp;
    spool off

    This will create a comma seperated output and spool it in a .csv file which you can directly open in an excel sheet.
    Amar
    "There is a difference between knowing the path and walking the path."

    Amar's Blog  Get Firefox!

  6. #6
    Join Date
    Jun 2003
    Location
    India
    Posts
    118
    U can use Spool and for readable format, from SQL prompt, u can set ur enviroment by setting linesize->custome and type the Nunber, and set the Pagesize to custome and type the Number.

    By this, u will be able to increase ur horizental & vertical lines.

    The spool file which u have created can be opened in Excel.
    vishal sood
    OCP 8

  7. #7
    Join Date
    Jun 2003
    Location
    australia
    Posts
    74
    Thanks heaps AMAR, it really helped me a lot.

    Regards
    rajorcl

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width