Export SQL Results To Excel Using SQLPLUS | PeopleSoft Tutorial
6

Export SQL Results To Excel Using SQLPLUS

Here is quick tip on how to easily export SQL results into an excel file.

Step 1: Login into database using SQL PLUS

Step 2: Set markup using below command

SET MARKUP HTML ON

Step 3: Spool the output to a file.

SPOOL C:\TEMP\MYOUTPUT.XLS

Step 4: Run your SQL Query

SQL QUERY

image

Step 5: Set the Spool Off.

image

Step 6: Open the output XLS file to view the output.

Prashant
 

  • Ramesh Kummara says:

    Thanks for the tips

  • srinivas says:

    Good tip.

    how to avoid break/titles per every 14 rows.

    PROJECTNAME DESCRLONG
    ….
    …..
    ….

    PROJECTNAME DESCRLONG

  • vidur says:

    I tried the above solution to send output of a query from sql*plus to an excel file, it works fine.
    But column headings are appearing after every 15 rows in the excel sheet, i want the headings to appear once only, what can i do to get rid of this problem?

  • Alice Gheorghiu says:

    Great post. It helped me complete my work project.
    Thanks so much,
    Alice

  • Dillip says:

    how to create multiple tabs in one single file using spool command.

  • Vidhya Sagar says:

    How to import the exported data in another PC?

  • >