0

Is there any SQL query for copying an Oracle database table's data into an Excel file?

Please let me know if there are any. Thanks

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
raj tiwari
  • 11
  • 1
  • 1
  • 4
  • Is this a one time question or though a program with repeat occurances?? and do you want the table structure or the data in the table? or are you talking about the DDL of the table... too many unknowns, Please provide context to your question. – xQbert Aug 26 '16 at 13:53
  • maybe this can help you: http://stackoverflow.com/questions/19448322/directly-export-a-query-to-csv-using-sql-developer – Ricardo Pontual Aug 26 '16 at 13:54
  • You can use one of the many SQL Clients (like SQL Developer or TOAD) to export a table directly to an Excel file. If you want to do this regularly / automatically, I suggest doing it the other way round. Use Excel VBA to query the data from your database and fill the sheets. – daZza Aug 26 '16 at 13:59
  • @xQbert sorry for not providing detailed information. Yeah it has the repeated occurences. I want the table data to be copied in proper format (so I guess the table structure should be copied). Actually I have pl/sql script which copies data to temp tables and I need to copy that temp table data to excel file. Please let me know if you need some more information. Thanks – raj tiwari Aug 26 '16 at 14:07
  • 1
    Use excel to pull the data, don't push it from database. http://superuser.com/questions/254526/how-can-i-make-excel-fetch-data-from-a-database-automatically-when-i-open-the-sp – xQbert Aug 26 '16 at 14:21
  • @xQbert Thanks, but I cannot do this in my scenario because copying data to excel file should be dynamic as well, this process sits between two systems, the excel file is processed after data is generated into it, so I cannot manually use excel file to pull the data. – raj tiwari Aug 26 '16 at 15:47

1 Answers1

0

You could look into query2sheet for PL/SQL (Oracle)

https://technology.amis.nl/2011/02/19/create-an-excel-file-with-plsql/

Iain
  • 387
  • 2
  • 12