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

Thread: exporting oracle data to csv

  1. #1
    Join Date
    Dec 2002
    Posts
    5

    exporting oracle data to csv

    What is the best way to export oracle dat to a coma delimited csv file? I like to be able to schedule this and each extract should contains a prefix as:
    ERA_[date/time].csv. I want to use this text file to import into one of our application which only read text delimited file. TIA.

    Any suggestion or tools that I need would be really helpful. As of today, I am thinking of doing the following but not sure how to get the date/time to the file name.

    set termout off
    set hea off
    set pagesize 0

    spool c:\whatever.csv

    select a.a||','||a.b||','||a.c
    from a
    where a.a="whatever";

    spool off

  2. #2
    Join Date
    Jul 2002
    Location
    Lake Worth, FL
    Posts
    1,492

    Talking


    Try this:
    Code:
    set termout off
    set hea off
    set pagesize 0
    col crdt new_value today
    select to_char(sysdate,'YYYYMMDD') crdt from dual;
    spool c:\whatever_&&today..csv
    
    select a.a||','||a.b||','||a.c
    from a
    where a.a="whatever";
    
    spool off


    "The person who says it cannot be done should not interrupt the person doing it." --Chinese Proverb

  3. #3
    Join Date
    Jun 2007
    Posts
    23
    You might also look at AskTom's solutions here: http://asktom.oracle.com/tkyte/flat/index.html
    Paul Barmaksezian
    Founder, Surfliner Services, LLC
    http://www.surflinerservices.com

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