User's Guide and Reference

Importing and exporting data

This section describes the processes of importing and exporting data, and explains how to use the Control Center to:

About importing and exporting

This section lists reasons for importing and exporting spatial data. It also discusses the data exchange files that serve as interfaces between sources of the export and targets of the import.

You can use DB2 Spatial Extender to import spatial data from, and export it to, data exchange files. Consider these scenarios:

The Control Center supports two kinds of data exchange files for DB2 Spatial Extender: shape files and ESRI_SDE transfer files. Shape files are often used for importing data that originates in file systems and for exporting data to files that are to be loaded into file systems. ESRI_SDE transfer files are often used for importing data that originates in ESRI databases.

Importing data to a new or existing table

This section gives an overview of the steps to import data from a shape or ESRI_SDE transfer file to a new or existing table. The overview is followed by details of how to complete each step.

To find out what authorization is required for importing shape data, see Authorization. To find out what authorization is required for importing ESRI_SDE data, see Authorization.

Overview of steps to import data to a new or existing table:

  1. Open the Import Spatial Data window.
  2. Specify the path, name, and format of the file that contains the data to be imported.
  3. Specify how many records to import before each commit.
  4. If you want to import spatial data to a table that is to be created, supply a name for this table and a name for the column that the data is intended for. If importing spatial data to an existing table, indicate which column the data is intended for.
  5. Specify which spatial reference system is to be associated with the data.
  6. Designate a file to collect the records that fail the import.
  7. Tell DB2 Spatial Extender to import the data and, if you defined a table from this window, to create the table and to register the column for which the data is intended as a layer.

Details of steps to import data to a new or existing table:

  1. Open the Import Spatial Data window.
    1. From the Control Center window, expand the object tree until you find the Databases folder under the server where you are running DB2 Spatial Extender.
    2. Click Databases folder. The databases are displayed in the contents pane on the right side of the window.
    3. Right-click the database to which you want to import data and click Spatial Extender --> Import Spatial Data in the pop-up menu. The Import Spatial Data window opens.
  2. Specify the path, name, and format of the file that contains the data to be imported:
    1. Use the File name field to specify the path and name.
    2. Use the File format box to specify the format. The format can be:

      Shape
      This is the default.

      ESRI_SDE
      If you specify this format, the Spatial reference name field defaults to the name of the spatial reference system that is associated with this format.
  3. Use the Commit scope field to specify the number of records that you want imported before each commit. For example, to require DB2 to commit 100 records at a time, specify the number 100.
    Tip:If you want DB2 to issue a commit only after all records are processed, specify zero.
  4. Specify the table and column that the data is intended for.
    1. Use the Layer schema box to specify the schema for the table to which data is to be imported.
    2. Specify the table and the column:
      • If the table does not yet exist:
        1. In the Layer table field, type a name for the table.
        2. In the Layer column field, type a name for the column that is to contain the imported data. DB2 Spatial Extender will automatically register this column as a layer.
      • If the table already exists:
        1. In the Layer table field, specify the table. It must already contain the column that you want the imported data to go into. In addition, this column must already be registered as a layer.
        2. In the Layer column field, specify the name of the column that the imported data is intended for.
  5. In the Spatial reference name field, type or select the spatial reference system that is to be associated with this data. (If the data is to come from an ESRI_SDE transfer file, the name of the associated spatial reference system is displayed in the field automatically.)
  6. In the Exception file field, specify the path and name for a new file into which records that fail the import can be collected. Later, you can fix these records and import them from this file.

    DB2 Spatial Extender will create this file; do not specify one that already exists.

  7. Click OK to import the data. Also, if you supplied a name for a table that does not exist yet, this table will be created and the column for which the data is intended will be registered as a layer. In addition, the exception file that you specified will be created.


[ Top of Page | Previous Page | Next Page ]