Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2003
    Location
    Atlanta
    Posts
    134

    Unhappy Unanswered: SQLPLUS spool to CSV file

    What is the better way that I can export data recordset to a .CSV file from Oracle SQLPLUS?

    I want to output the records with comma seperated values to a .CSV file on Unix and "ftp" to a Windows2000 Desktop and open in MSEXCEL.

    select * from table1.

    I have to schedule this on Unix through cron job and therefore using SQLPlus command scripts to run it.

    Thanks, Vinnie

  2. #2
    Join Date
    May 2006
    Posts
    132
    If you want to do it directly to Excel format, you could schedule an Oracle job and follow this process Using an Oracle database link to connect to Excel. Alternatively, you could schedule an Oracle job and spool to a file:

    Code:
    SQL> select empno||','||ename from scott.emp;
    
    EMPNO||','||ENAME
    -----------------
    7369,SMITH
    7499,ALLEN
    7521,WARD
    7566,JONES
    ...
    Course, you could always give Tom's unloader a shot.

Posting Permissions

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