Oracle sql developer экспорт в excel

Do you find it difficult to export your data from Oracle SQL Developer to excel and CSV format? Have you ever just banged your hands at the keyboard, closed your eyes, and thought “Is it supposed to be this hard?”. Well, the answer is NO. This post will guide you step by step with necessary screenshots through the whole process of Oracle SQL Developer export to excel & CSV format.

It’s every developer’s dream to be able to manipulate and convert their data into any format. Often this takes a lot of effort and resources just to get the already painstakingly gathered data to the desired format. One such example is exporting your data from Oracle SQL Developer to excel and CSV format. 

Introduction To Oracle SQL Developer

Oracle offered a database IDE in the form of Oracle SQL Developer. It supports the graphical user interface i.e. any user or administrator can perform the database activities in fewer clicks. It simplifies Oracle database development and management on a traditional and cloud-based platform. They also provide export and import utilities to their users. You can explore more about the functionalities of Oracle here.

Oracle’s main objective is to save the user’s time and effort in every possible way. So, the process of Oracle SQL Developer export to excel and CSV format should be a painless and ephemeral task. Let’s see how you will conquer this feature of Oracle.

Oracle SQL Developer Export to Excel: Oracle SQL

Image Source: www.logo.wine/logo

Hevo offers a faster way to move data from databases such as Oracle; SaaS applications and 100+ other data sources into your data warehouse to be visualized in a BI tool. Hevo is fully automated and hence does not require you to code.

Get Started with Hevo for Free

Let’s look at the benefits of using Hevo:

  • Secure Data Transfer: Hevo offers two-factor authentication and end to end encryption, which makes sure that the data movement is safe and secure.
  • Fully-Automated: Hevo platform requires minimal maintenance and management. This fully automated service is a wise choice for anyone.
  • Auto Mapping: It can automatically create the schema by mapping the data from the source to the destination schema. Hevo takes care of the mapping even when there are changes in the latter stage.
  • Scalability: Hevo can handle millions of records per minute without any latency. The data pipelines are scaled according to the requirement.
  • Friendly Live Support: Hevo team is ready to offer a helping hand at any time through emails, chat, and calls. 

Sign up here for a 14-Day Free Trial!

Download the Ultimate Guide on Database Replication

Download the Ultimate Guide on Database Replication

Download the Ultimate Guide on Database Replication

Learn the 3 ways to replicate databases & which one you should prefer.

Let’s see what you will cover here:

  • Prerequisites
  • Steps For The Exporting Process

Prerequisites

  • Oracle SQL Developer installed on your system.
  • Knowledge about RDBMS.

Steps For The Exporting Process

The steps involved in creating an excel and CSV file from the data in Oracle SQL Developer are listed below:

  1. Connect Your Database
  2. Run Your Query
  3. Export Your Data
  4. Select Your Desired Format
  5. Use Your Data In The Desired Format

Step 1: Connect Your Database

Connect to your database in Oracle SQL Developer by using the correct credentials of your database. This database contains the data that needs to be exported to an Excel or CSV file.

Oracle SQL Developer home

Image Source: www.docs.oracle.com/en/cloud

Step 2: Run Your Query

Write the following command in the SQL worksheet and execute it by clicking the run button on the top left corner of the worksheet. You can also use any other query to get your desired output.

SELECT * FROM ACCOUNTS;

Run Query

Image Source: www.youtube.com

Step 3: Export Your Data

Right-click on the query result and select Export from the drop-down menu.

Oracle SQL Developer Export

Image Source: www.stackoverflow.com/questions

Step 4: Select Your Desired Format

In the Export Wizard, select “excel 2003+ (xlsx)” for excel versions above 2003 or “excel 95-2003 (xls)” for excel version between 95 and 2003 or “csv” in the format, and then determine your destination location. Click “Next” and then “Finish”.

Oracle SQL Export Wizard

Image Source: www.docs.oracle.com/cd

Step 5: Use Your Data In The Desired Format

Finally, you can go to your destination location and open the exported data in the specified format.

Conclusion

You have learned the process of Oracle SQL Developer export to excel and CSV format. The data that you have exported is usually needed for backup or to transfer that data to another database or a data warehouse. Extracting complex data from a diverse set of data sources can be a challenging task and this is where Hevo saves the day!

Visit our Website to Explore Hevo

Hevo, a No-code Data Pipeline helps you transfer data from Oracle SQL Developer in a fully automated and secure manner without having to write the code repeatedly. Hevo, with its secure integrations with 100+ sources & BI tools, allows you to export, load, transform, & enrich your data & make it analysis-ready in a jiffy.

Want to take Hevo for a spin? Sign Up for a 14-day free trial and experience the feature-rich Hevo suite first hand. You can also have a look at the unbeatable pricing that will help you choose the right plan for your business needs.

Let us know about your experience of Oracle SQL Developer export to Excel and CSV in the comment section below. 

No-code Data Pipeline for Oracle

Do you need to export your query output to an Excel file in SQL Developer?

If so, you’ll see the complete steps to accomplish this goal.

Step 1: Run your query

To start, you’ll need to run your query in SQL Developer. You can run any query based on your needs.

Step 2: Open the Export Wizard

Once you’re done running the query in SQL Developer, you’ll see the query output at the bottom of your screen.

Right-click on any cell on the query results, and then select the ‘Export…‘ option from the drop down menu.

You’ll then see the Export Wizard.

Step 3: Select the Excel format and the location to export your file

Now you’ll need to:

  1. Select the Excel format from the drop-down list. You can choose the xlsx format for recent versions of Excel, or the xls format for previous versions of Excel
  2. Click on the ‘Browse…‘ button to select the location where the Excel file will be saved
  3. Press on the ‘Next >‘ button once you are done

Step 4: Export the query output to Excel

For the final step, click on the ‘Finish‘ button to export the query output to Excel.

Conclusion

You just saw how to export your query output to Excel in SQL Developer. You can choose to export your query results to either the xlsx format for newer versions of Excel, or the xls format for previous versions of Excel.

If you need to export your query output to a CSV file, you may then check the following guide that explains the steps to export your query results to CSV in SQL Developer. Alternatively, you may apply spool to accomplish the same goal.

I got some records from Oracle SQL developer & in the output query result. I want to copy the data & paste into the Excel sheet. How to copy the records from output of oracle SQL developer to Excel sheet.

asked Dec 14, 2017 at 7:23

Shahin P's user avatar

2

As I understand, accepted answer will get you results w/out headers. You can use right-click on results -> export there use clipboard as save-as, format -> delimited and the trick — delimiter to TAB (at least with tab paste works properly for my Excel version, default comma does not).

answered Mar 19, 2019 at 14:28

Alex Martian's user avatar

Alex MartianAlex Martian

3,3147 gold badges35 silver badges69 bronze badges

It’s simple, select all the records from the output query result and copied it by using Ctrl+C then after open new DataBase File on top left side of the Oracle SQL developer. Then after paste all the data there into that DataBase File. Again copied the data from that DataBase files using Ctrl+C & paste it into the Excel Sheet.

answered Dec 14, 2017 at 7:39

Md Wasi's user avatar

Md WasiMd Wasi

4563 silver badges16 bronze badges

1

Click on a cell in the output query results column and then press Ctrl + A to select all the records from the output query results. Then, press Shift+Ctrl+C to copy all the data and now go to your excel sheet and paste it.

answered Feb 27, 2022 at 22:45

Guest's user avatar

I have a small project where data from Oracle SQL Developer needs to be exported to Excel (using commands rather than tools in SLQ Developer), then create a graph.
Using «spool» I can export to csv fine (but cant make a graph in csv) but when I try to export to xlsx it corrupts the whole excel sheet saying

"Excel cannot open the file "ExcelFile.xlsx" because the file format or file extention 
       is not valid. Verify that the file has not been corrupted and that the 
       file extension mathces the format of the file."

Here is the code I used in SQL Developer.

spool FileLocationExcelFile.xlsm
SELECT * FROM Table;
spool off;

Is there any way I can stop the data from becoming corrupted or is there another way to export data to a .xlsx file?

thebluephantom's user avatar

asked Jun 23, 2017 at 15:22

IAmRapson's user avatar

5

Nooooooo.

set sqlformat csv
spool c:file.sql
select * from table;
spool off;

then open the file in excel.

OR

Run your query interactively.

Right click on the grid, Export > XLSX. Open the file.

Spool only writes the query output to the file, it doesn’t look at the file extension and figure out HOW to write the output at that point.

So you either have to code it yourself via the query, or use one of the format outputs we support

SET SQLFORMAT
  CSV
  JSON
  DELIMITED
  XML
  HTML
  INSERT
  LOADER

Use ‘help set sqlformat’ for help.

answered Jun 23, 2017 at 22:06

thatjeffsmith's user avatar

thatjeffsmiththatjeffsmith

19.8k4 gold badges38 silver badges115 bronze badges

1

Hi sql developer from what I know for exporting is using sqlplus(code is same) so perhabs there are other ways but this one should be good enough

I would try changing first line to look like this:

spool ExcelFile.xls

Probably you also need to turn on

SET MARKUP HTML ON

http://www.orahow.com/2015/09/spool-sqlplus-output-to-excel-format.html

Anyway there is workaround — you can just generate .CSV file and then open it in excel and save as .xlsx file

answered Jun 23, 2017 at 15:27

kpazik's user avatar

kpazikkpazik

1752 silver badges11 bronze badges

1

I was also facing the same problem then applied below code and it exported successfully..

import xlsxwriter
from xlsxwriter import Workbook
import cx_Oracle
import datetime
from datetime import date

dsn_tns = cx_Oracle.makedsn('HOST', 'PORTNO', sid='BGRDB') 
    
db = cx_Oracle.connect(user=r'username', password='password', dsn=dsn_tns)
cursor = db.cursor()

workbook = xlsxwriter.Workbook('C:/Path/outfile.xlsx')
sheet = workbook.add_worksheet()


cursor.execute("select * from TABLENAME")
for r, row in enumerate(cursor.fetchall()):
         for c, col in enumerate(row):
                sheet.write(r, c, col)

workbook.close()
cursor.close()

answered Jun 29, 2020 at 15:11

Nishika Gangrade's user avatar

The export function for query result is not so obvious for developers to find out. In this post, I will show how to export query result as a Excel file.

Show Query Result as Grid

To show the query result in a grid table, you have to use F9 or Ctrl+Enter to format query result in grid.

SQL Developer Query Result

SQL Developer Query Result

Right Click Mouse and Export

Move your cursor over anywhere on the grid and right click the mouse, you will see Export option.

SQL Developer Query Result - Export

SQL Developer Query Result — Export

Export Entire Table

If the data you want to export is a table, not a query result, you can directly right-click on the table and select Export in the menu.

SQL Developer - Table Menu - Export

SQL Developer — Table Menu — Export

Select Export Format

SQL Developer showed Export Wizard window for interaction. Although there’re many export types for us to select, we chose Excel format in this case.

SQL Developer Query Result - Export Format - Excel (.xls)

SQL Developer Query Result — Export Format — Excel (.xls)

Select Text Encoding

I chose UTF-8 in order to match the database encoding.

SQL Developer Query Result - Export Encoding - UTF-8

SQL Developer Query Result — Export Encoding — UTF-8

Customize Filename

If you want to change the path, you can click Browse to navigate and choose a right directory to place.

SQL Developer Query Result - Export File Name - Browse

SQL Developer Query Result — Export File Name — Browse

Review Export Job Before Executing

You can expand all options to see the content of the export job.

SQL Developer Query Result - Export - Summary

SQL Developer Query Result — Export — Summary

Check Content of Excel File

We open the Excel file in an application, so they can be viewed its content below.

SQL Developer Query Result - Export - Excel File Content

SQL Developer Query Result — Export — Excel File Content

That’s it!

Next, we can restore the Excel data back into table by importing data in SQL Developer whenever needed.

  • Click to view our Accessibility Policy
  • Skip to content

How-To Document

How to Export Data using SQL Developer

Updated: Nov 2009 for SQL Developer 2.1
After completing this How-To, you should be able to understand:

  • How to export data to various file formats using SQL Developer
  • How to export the object definitions in your schema
  1. Introduction
  2. Oracle SQL Developer provides utilities to export both the definitions of the objects in a schema and the data stored in those objects. In this How-To we start by exporting the data and then move onto exporting object definitions.

  3. Software Requirements
    1. Oracle SQL Developer
    2. Oracle Database 9.2.0.1 or later
    3. Access to the Sample User Account HR (See Step 2 of this Getting Started: Oracle SQL DeveloperGuide)
  4. Exporting Data

    SQL Developer provides the ability to export user data to a variety of formats: CSV, XML, LOADER, TEXT, INSERT, HTML and XLS.

    1. In order to export the data from a table you can either use the SQL Worksheet and write a SQL query to retrieve the required data or you can Click on the Data tab of a table definition. We’ll use this latter approach.
    2. Expand the Connections Navigator and the Tables node.

      Click on DEPARTMENTS.

      Select the Data tab.

    3. Right-click anywhere on the data to invoke the context menu.
    4. Select insert from the Export Data context menu. This will produce a file of insert statements.

    5. Choose an appropriate directory and name for the file.
    6. You can also fine tune what is exported by selecting the columns and adding a where clause to reduce the number of records returned. In this example, we’ll take the default of all the records and columns.

    7. Click Apply to create the file.
    8. To review the file created, click the Open Folder icon  . Select the new file DEPARTMENTS.sql from your file directory. The sql file will open into a SQL Worksheet.
  5. Exporting Object Definitions

    SQL Developer provides the ability to export some or all of your object definitions to script files. You can use these as a backup of the object definitions or run them in another schema. In this exercise, you export all the object definitions and the data for the Departments table.

    1. Using the main menu, select Tools->Database Export.
    2. An Export wizard will open. At the top of the screen, enter a directory and file name. e.g. C:WorkingexportDept.sql. and select the Connection.
    3. Set the DDL Options for this Export. e.g. check Include Drop Statement.
    4. Click Next.

    5. In this step, you can slect what Object Types to export. We will take the default for all object types.

      Click Next.

    6. In this step, you can specify the objects to export. Instead of querying all objects by immediately selecting Go, you can enter a restriction criteria. Enter D% and then click Go.
    7. You can restrict the list of choices further by using the drop list on the right.. Select Table from the list of object types.
    8. Click Go. The list now displays tables that start with «D».

    9. Select the table Departments and shuttle to the right hand panel.
    10. Click Next.

    11. In this step, you can specify the data that gets exported. Click Go and a list of tables will be listed. Shuttle Departments to the right hand panel..
    12. Click Next.

    13. In this final step, you can review your Export Summary.

      Click Finish.

    14. To review the file created, go to the main menu and select View-> Files to open the Files Navigator tab. Select the new file exportDept.sql from your file directory. The sql file will open into a SQL Worksheet.
  6. Additional Resources
  • There are many SQL examples in the Database Documentation on OTN
  • Discuss this how-to in the OTN SQL Developer Forum.

Содержание

  1. Oracle sql developer export data to excel
  2. Table of Contents
  3. Export Query Output to Excel in SQL Developer
  4. Steps to export query output to Excel in SQL Developer
  5. Step 1: Run your query
  6. Step 2: Open the Export Wizard
  7. Step 3: Select the Excel format and the location to export your file
  8. Step 4: Export the query output to Excel
  9. Conclusion
  10. How SQL Developer Export to Excel
  11. Export to Excel
  12. Show Query Result as Grid
  13. Right Click Mouse and Export
  14. Export Entire Table
  15. Select Export Format
  16. Select Text Encoding
  17. Customize Filename
  18. Review Export Job Before Executing
  19. Check Content of Excel File
  20. Oracle SQL Developer To Excel & CSV: 5 Steps To Move Data Conveniently
  21. Table of Contents
  22. Introduction To Oracle SQL Developer
  23. Tutorial: Exporting Query Results
  24. Exporting Data from a Grid
  25. Exporting Data from a Script
  26. Product Managers who Blog..about their Products
  27. Quick Tip: Spooling to ‘Excel’
  28. Related Posts
  29. Inserting multi-line strings with SQLcl & SQLBLANKLINES
  30. Oracle REST APIs & Query Parameter Examples using EMPLOYEES
  31. Using SQLcl & Liquibase DIFF command to compare schemas
  32. Export your Oracle Autonomous Database using Data Pump
  33. SQL Developer Web: Cleaning up data loading error logs
  34. Data Pump & SQL Developer Web for Oracle Autonomous Database
  35. 23 Comments

Oracle sql developer export data to excel

How to Export Data using SQL Developer

Updated: Nov 2009 for SQL Developer 2.1
After completing this How-To, you should be able to understand:

  • How to export data to various file formats using SQL Developer
  • How to export the object definitions in your schema

Table of Contents

Oracle SQL Developer provides utilities to export both the definitions of the objects in a schema and the data stored in those objects. In this How-To we start by exporting the data and then move onto exporting object definitions.

  • Software Requirements
    1. Oracle SQL Developer
    2. Oracle Database 9.2.0.1 or later
    3. Access to the Sample User Account HR (See Step 2 of this Getting Started: Oracle SQL DeveloperGuide)
  • Exporting Data

    SQL Developer provides the ability to export user data to a variety of formats: CSV, XML, LOADER, TEXT, INSERT, HTML and XLS.

      In order to export the data from a table you can either use the SQL Worksheet and write a SQL query to retrieve the required data or you can Click on the Data tab of a table definition. We’ll use this latter approach.

    Expand the Connections Navigator and the Tables node.

    Click on DEPARTMENTS.

    Select the Data tab.

    Right-click anywhere on the data to invoke the context menu.

    Select insert from the Export Data context menu. This will produce a file of insert statements.

    Choose an appropriate directory and name for the file.

    You can also fine tune what is exported by selecting the columns and adding a where clause to reduce the number of records returned. In this example, we’ll take the default of all the records and columns.

  • Click Apply to create the file.
  • To review the file created, click the Open Folder icon . Select the new file DEPARTMENTS.sql from your file directory. The sql file will open into a SQL Worksheet.
  • Exporting Object Definitions

    SQL Developer provides the ability to export some or all of your object definitions to script files. You can use these as a backup of the object definitions or run them in another schema. In this exercise, you export all the object definitions and the data for the Departments table.

      Using the main menu, select Tools->Database Export.

    An Export wizard will open. At the top of the screen, enter a directory and file name. e.g. C:WorkingexportDept.sql. and select the Connection.

    Set the DDL Options for this Export. e.g. check Include Drop Statement.

    Click Next.

    In this step, you can slect what Object Types to export. We will take the default for all object types.

    Click Next.

    In this step, you can specify the objects to export. Instead of querying all objects by immediately selecting Go, you can enter a restriction criteria. Enter D% and then click Go.

    You can restrict the list of choices further by using the drop list on the right.. Select Table from the list of object types.

    Click Go. The list now displays tables that start with «D».

    Select the table Departments and shuttle to the right hand panel.

    Click Next.

    In this step, you can specify the data that gets exported. Click Go and a list of tables will be listed. Shuttle Departments to the right hand panel..

    Click Next.

    In this final step, you can review your Export Summary.

    Click Finish.

  • To review the file created, go to the main menu and select View->Files to open the Files Navigator tab. Select the new file exportDept.sql from your file directory. The sql file will open into a SQL Worksheet.
  • Additional Resources
    • There are many SQL examples in the Database Documentation on OTN
    • Discuss this how-to in the OTN SQL Developer Forum.

    Источник

    Export Query Output to Excel in SQL Developer

    Do you need to export your query output to an Excel file in SQL Developer?

    If so, you’ll see the complete steps to accomplish this goal.

    Steps to export query output to Excel in SQL Developer

    Step 1: Run your query

    To start, you’ll need to run your query in SQL Developer. You can run any query based on your needs.

    Step 2: Open the Export Wizard

    Once you’re done running the query in SQL Developer, you’ll see the query output at the bottom of your screen.

    Right-click on any cell on the query results, and then select the ‘Export…‘ option from the drop down menu.

    You’ll then see the Export Wizard.

    Step 3: Select the Excel format and the location to export your file

    Now you’ll need to:

    1. Select the Excel format from the drop-down list. You can choose the xlsx format for recent versions of Excel, or the xls format for previous versions of Excel
    2. Click on the ‘Browse…‘ button to select the location where the Excel file will be saved
    3. Press on the ‘Next >‘ button once you are done

    Step 4: Export the query output to Excel

    For the final step, click on the ‘Finish‘ button to export the query output to Excel.

    Conclusion

    You just saw how to export your query output to Excel in SQL Developer. You can choose to export your query results to either the xlsx format for newer versions of Excel, or the xls format for previous versions of Excel.

    If you need to export your query output to a CSV file, you may then check the following guide that explains the steps to export your query results to CSV in SQL Developer. Alternatively, you may apply spool to accomplish the same goal.

    Источник

    How SQL Developer Export to Excel

    Export to Excel

    The export function for query result is not so obvious for developers to find out. In this post, I will show how to export query result as a Excel file.

    Show Query Result as Grid

    To show the query result in a grid table, you have to use F9 or Ctrl + Enter to format query result in grid.

    SQL Developer Query Result

    Right Click Mouse and Export

    Move your cursor over anywhere on the grid and right click the mouse, you will see Export option.

    SQL Developer Query Result — Export

    Export Entire Table

    If the data you want to export is a table, not a query result, you can directly right-click on the table and select Export in the menu.

    SQL Developer — Table Menu — Export

    Select Export Format

    SQL Developer showed Export Wizard window for interaction. Although there’re many export types for us to select, we chose Excel format in this case.

    SQL Developer Query Result — Export Format — Excel (.xls)

    Select Text Encoding

    I chose UTF-8 in order to match the database encoding.

    SQL Developer Query Result — Export Encoding — UTF-8

    Customize Filename

    If you want to change the path, you can click Browse to navigate and choose a right directory to place.

    SQL Developer Query Result — Export File Name — Browse

    Review Export Job Before Executing

    You can expand all options to see the content of the export job.

    SQL Developer Query Result — Export — Summary

    Check Content of Excel File

    We open the Excel file in an application, so they can be viewed its content below.

    SQL Developer Query Result — Export — Excel File Content

    Источник

    Oracle SQL Developer To Excel & CSV: 5 Steps To Move Data Conveniently

    Table of Contents

    Do you find it difficult to export your data from Oracle SQL Developer to excel and CSV format? Have you ever just banged your hands at the keyboard, closed your eyes, and thought “Is it supposed to be this hard?”. Well, the answer is NO. This post will guide you step by step with necessary screenshots through the whole process of Oracle SQL Developer export to excel & CSV format.

    Table of Contents

    It’s every developer’s dream to be able to manipulate and convert their data into any format. Often this takes a lot of effort and resources just to get the already painstakingly gathered data to the desired format. One such example is exporting your data from Oracle SQL Developer to excel and CSV format.

    Introduction To Oracle SQL Developer

    Oracle offered a database IDE in the form of Oracle SQL Developer. It supports the graphical user interface i.e. any user or administrator can perform the database activities in fewer clicks. It simplifies Oracle database development and management on a traditional and cloud-based platform. They also provide export and import utilities to their users. You can explore more about the functionalities of Oracle here.

    Oracle’s main objective is to save the user’s time and effort in every possible way. So, the process of Oracle SQL Developer export to excel and CSV format should be a painless and ephemeral task. Let’s see how you will conquer this feature of Oracle.

    Hevo offers a faster way to move data from databases such as Oracle; SaaS applications and 100+ other data sources into your data warehouse to be visualized in a BI tool. Hevo is fully automated and hence does not require you to code.

    Let’s look at the benefits of using Hevo:

    • Secure Data Transfer: Hevo offers two-factor authentication and end to end encryption, which makes sure that the data movement is safe and secure.
    • Fully-Automated: Hevo platform requires minimal maintenance and management. This fully automated service is a wise choice for anyone.
    • Auto Mapping: It can automatically create the schema by mapping the data from the source to the destination schema. Hevo takes care of the mapping even when there are changes in the latter stage.
    • Scalability: Hevo can handle millions of records per minute without any latency. The data pipelines are scaled according to the requirement.
    • Friendly Live Support: Hevo team is ready to offer a helping hand at any time through emails, chat, and calls.

    Sign up here for a 14-Day Free Trial!

    Источник

    Tutorial: Exporting Query Results

    This is a 101 level type of topic – a fundamental bit of SQL Developer that I would encourage everyone to be familiar with. Why? Because it’s probably something you’ll be doing, A LOT. So let’s get into it, already!

    You have two options for getting data from a query into a FILE.

    1. right-clicking on a result grid
    2. spooling to a file

    Grid Exports

    The ubiquitous data grid!

    Spooling

    Exporting Data from a Grid

    Here’s what happens.

    You’re executing a query, browsing a TABLE, or running a report.

    You right-click on it.

    What happens next?

    You get a 2 screen wizard. The first screen looks like this:

    Here comes trick #1

    Trick #1: You’re going to be doing this, A LOT. So, go into preferences and setup your defaults. You can see by my screenshot that I’m most frequently doing CSV exports directly to my clipboard.

    Once you’ve set what you want, and click NEXT, you review what you’ve asked for and say FINISH.

    But then what happens?

    WE EXECUTE THE QUERY AGAIN. Grab the results, format them based Wizard settings, and feed them to the destination you’ve selected.

    Trick #3: If you’re dealing with a large amount of records and are exporting to Excel, always choose the XLSX format (we list it first). If you choose XLS instead, stubbornly, it’s going to peter out after a hundred thousand rows or so…if you do not see the XLSX format option, that means YOU NEED TO UPGRADE SQL DEVELOPER.

    Trick #4: If you have BLOBs in your query resultset, the ONLY way to export those out successfully is to use the Loader format option.

    Exporting Data from a Script

    Once you’ve ran the script and are looking at the results, the only way to get those into a file is to copy/paste.

    So, what you need to do is tinker with your script, and have it use the SPOOL command.

    SPOOL is a SQL*Plus feature that we support in SQL Developer. You have access to this command and other script processing bits when you use THIS button (or F5) to execute something.

    This one!

    We do better than just support the SPOOL command. We have built some additional commands to make working with FILES much easier.

    Let’s look at this ‘script’:

    The ‘cool’ parts of this script are:

    And that’s it. Well, that’s ALMOST it. If you have a VERY LARGE result-set, writing those query results to the screen AND to the file at the same time is going to be a major BUMMER.

    And now you know, the rest of the story.

    I’m a Distinguished Product Manager at Oracle. My mission is to help you and your company be more efficient with our database tools.

    Product Managers who Blog..about their Products

    Quick Tip: Spooling to ‘Excel’

    Inserting multi-line strings with SQLcl & SQLBLANKLINES

    Oracle REST APIs & Query Parameter Examples using EMPLOYEES

    Using SQLcl & Liquibase DIFF command to compare schemas

    Export your Oracle Autonomous Database using Data Pump

    SQL Developer Web: Cleaning up data loading error logs

    Data Pump & SQL Developer Web for Oracle Autonomous Database

    Hi Jeff, when exporting to .xlsx or .csv is it possible to change the font the data is exported in?

    I doubt we assign a font to a csv file…

    Do you mean file encoding?

    Hope you are well. I have been trying to export the result of a query. However I seem to get the following stack trace:
    java.lang.NullPointerException
    at java.io.File.(File.java:277)
    at oracle.dbtools.raptor.export.ExportGenerationOutputStream.closeCurrentStream(ExportGenerationOutputStream.java:537)
    at oracle.dbtools.raptor.export.ExportGenerationOutputStream.finished(ExportGenerationOutputStream.java:464)
    at oracle.dbtools.raptor.export.ExportAPI$1.doWork(ExportAPI.java:1490)
    at oracle.dbtools.raptor.export.ExportAPI$1.doWork(ExportAPI.java:1453)
    at oracle.dbtools.raptor.backgroundTask.RaptorTask.call(RaptorTask.java:199)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at oracle.dbtools.raptor.backgroundTask.RaptorTaskManager$RaptorFutureTask.run(RaptorTaskManager.java:702)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

    The actual query that I am trying to run is about 660KB in size. I tried to reproduce the issue with the different query – shown below. The version of SQL developer is v18.4 . I was able to reproduce on v20.2 as well.

    select sysdate, case when (1 = 2 or 1 = 2 or …. 1 = 2) THEN ‘EQUAL’ ELSE ‘NOT EQUAL’ end as CASE_VALUE from dual;

    Around the time this SQL query reaches 8260-8280 bytes in size. The export from SQL developer fails with the above stack trace.

    Just in case, please go try version 20.4, it has lots of bug fixes over 20.2.

    Источник

    Понравилась статья? Поделить с друзьями:
  • Oracle sql developer выгрузить результат запроса в excel
  • Oracle sql developer import from excel
  • Oracle sql and excel
  • Oracle smart view excel
  • Oracle odbc driver 64 bit excel