Merge different table structures

Use a variation of the INSERT statement and a global temporary table to rearrange the import data to fit the table.

Prerequisites

DBA authority.

Context and remarks

Many.

 Load data with a different structure using a global temporary table
  1. In the SQL Statements pane, create a global temporary table with a structure matching that of the input file.

    You can use the CREATE TABLE statement to create the global temporary table.

  2. Use the LOAD TABLE statement to load your data into the global temporary table.

    When you close the database connection, the data in the global temporary table disappears. However, the table definition remains. You can use it the next time you connect to the database.

  3. Use the INSERT statement with a SELECT clause to extract and summarize data from the temporary table and copy the data into one or more permanent database tables.

Results

The data is loaded into a permanent database table.

Next

None.

 See also