5.1.6 Unloading Data

Use the Unload Data page to export the contents of a table to a text file or XML document.

5.1.6.1 Unloading a Text File

Use the Unload Data wizard to export the contents of a table to a text file.

For example, you could export an entire table to a comma-delimited file (.csv).

To unload a table to a text file:

  1. On the Workspace home page, click the SQL Workshop icon.
  2. Click Utilities.
  3. Click Data Workshop.
  4. Under Get Started, click Unload Data.

    The Unload Data Wizard appears.

  5. Select Text Format and click Next.

    The Unload to Text - Columns appears.

  6. On Unload Text - Columns, edit the following:
    1. Schema - Select the database schema that owns the object you would like to export.
    2. Table - Select the database table you would like export to a plain text format.
    3. Columns - Highlight the columns you would like to be part of this plain text file. Only Oracle built in data types except BLOB and BFILE are supported to unload.
    4. Where Clause - Enter SQL WHERE clause to limit the rows that are selected. For example: DEPTNO = 10
    5. Click Next.
  7. For Options, enter the following:
    1. Separator - Specify the type of separator used to separate the column values on each line. The default value is a comma (,). To use a tab as a column separator, enter a backslash followed by the letter "t" ().
    2. Optionally Enclosed By - Use this option to specify how to identify text strings in a column. You can specify single or double quotation marks.
    3. Include Column Names - Check this box to include the name of each column in the text file.
    4. File Format - Select DOS to have the lines in the resulting file terminated by carriage returns and line feeds. Select UNIX to have the lines in the resulting file contain terminated by line feeds.
    5. File Character Set - Select the character set to encode the export file.
  8. Click Unload Data.

    The file is downloaded.

5.1.6.2 Unloading to an XML Document

Use the Unload Data Wizard to export the contents of a table to an XML document adhering to the Canonical XML specification.

To unload a table to an XML document:

  1. On the Workspace home page, click the Utilities icon.
  2. Click Data Workshop.
  3. Under Get Started, click Unload Data.

    The Unload Data Wizard appears.

  4. Select XML Format and click Next.

    The Unload to XML - Columns appears.

  5. On Unload to XML - Columns, edit the following:
    1. Table Owner - Select the database schema that owns the object you would like to export.
    2. Table - Select the database object name you would like to export to an XML file format.
    3. Columns - Highlight the database object columns you would like to export to an XML document.
    4. Where Clause - Enter SQL WHERE clause to limit the rows that are selected. For example: DEPTNO = 10
    5. Click Next.
  6. Click Unload Data.

    The file is downloaded.