Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6078617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:51:15+00:00 2026-05-23T10:51:15+00:00

Oracle SQL Developer has an option to export the contents of a query result

  • 0

Oracle SQL Developer has an option to export the contents of a query result to various formats (CSV/fixed width/Excel/XML). Is there any way to automate it?

If not, what free tools are available that will let me automate exports into the same formats that SQL Developer is capable of exporting to?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T10:51:15+00:00Added an answer on May 23, 2026 at 10:51 am

    I don’t know of a way to automate SQL Developer exports, no.

    However, it’s easy enough to generate CSV and/or fixed width files from PL/SQL (using the UTL_FILE package). Tom Kyte has an example of programs that generate CSV or fixed width files using either PL/SQL or Pro*C. Either can be relatively easily automated using your favorite scheduler.

    XML outputs can be automated in much the same way depending on how much control you need over the XML that is actually generated. If you just need valid XML and don’t care about the format of that XML, you can do something like this using the DBMS_XMLGEN package (this example is straight from the documentation).

    DECLARE
      qryCtx DBMS_XMLGEN.ctxHandle;
      result CLOB;
    BEGIN
      qryCtx := DBMS_XMLGEN.newContext('SELECT * FROM hr.employees');
      -- Set the row header to be EMPLOYEE
      DBMS_XMLGEN.setRowTag(qryCtx, 'EMPLOYEE');
      -- Get the result
      result := DBMS_XMLGEN.getXML(qryCtx);
      INSERT INTO temp_clob_tab VALUES(result);
      --Close context
      DBMS_XMLGEN.closeContext(qryCtx);
    END;
    /
    

    You could then write the result CLOB to a file using UTL_FILE and, again, use your favorite scheduler to schedule it.

    If you just need to generate a file that Excel can open, you probably just need to create a CSV or a tab-delimited file. Excel can open either type of file relatively easily though you do get the extra step of being prompted to accept the delimiter that it found (it generally detects the delimiter correctly).

    Generating native Excel output is a bit more challenging. There are PL/SQL APIs for generating Excel files such as Jason Bennett’s ExcelDoctypeUtils. But I’ve always gone with a Java stored procedure that used either the JExcelAPI or that Apache POI to generate the Excel file. This, obviously, requires a bit more work to implement. Once you have a stored procedure that can write an Excel file, as with the other options, you can automate calling that procedure using your favorite scheduler.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Oracle SQL Developer to query an Oracle DB (not sure which version
I recently upgraded to Oracle Sql Developer 2.1 It's far better, but the query
When I let this Query run in my Oracle SQL Developer 1.5.3 select COLUMNNAME
Using Oracle SQL Developer I'm trying to access a given package that has been
I'm trying to import some data (using oracle sql developer) from a .csv file
In Oracle SQL Developer, one can list the data in a table using the
I have Oracle SQL Developer already installed and am able to connect to and
I am using Oracle SQL Developer, but I am having an issue seeing results
I'm using Oracle SQL Developer. I'd like to key in dates with hours and
I'm trying this with Oracle SQL Developer and am on an Intel MacBook Pro.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.