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

Thread: Get data out of Oracle to flat file

  1. #1
    Join Date
    Nov 2000
    Posts
    205
    My scenario is this:

    I want to get data out of an Oracle Database, periodically, in a format that can be read by other people, not just another Oracle database.

    Any suggestions?

    using triggers etc???

    Thanks in advance,
    Nirasha
    Nirasha Jaganath

  2. #2
    Join Date
    May 2001
    Posts
    4
    You can use a select statement to format the data as a comma seperated file(.csv) that can be viewed in excel. Here is an example of how to write the statement:

    spool d:\flat_file.csv
    Select
    column1||','||
    column2||','||
    column3
    from table;
    spool off

    Is this what you are looking for?

  3. #3
    Join Date
    Oct 2000
    Location
    Saskatoon, SK, Canada
    Posts
    3,925
    Or you can use the utl_file to save the data on to a flat file and put the procedure under a dbms_job, that get executed at the specified intervals

    On the previous case, you have to use the cron job execute a script that in turn would execute the sql code for you.

    Choice is yours.

    Sam
    Thanx
    Sam



    Life is a journey, not a destination!


  4. #4
    Join Date
    Nov 2000
    Posts
    205
    Kind of, but I guess I would need alot of triggers to kick this off. I need only updates. db to db would be easier, but I was asked to consider it this way, so to make it more robust. Also if there alot of tables, things might get complex.

    Thanks,
    Nirasha
    Nirasha Jaganath

  5. #5
    Join Date
    Feb 2000
    Location
    Washington DC
    Posts
    1,843

  6. #6
    Join Date
    Nov 2000
    Posts
    205
    Thanks so much you guys. All of this was loads of help.

    Nirasha Jaganath

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