Importing table contents of a saved file into a database table
You can import the table contents that are saved in a file into a database table by using Import Table Wizard.
About this task
Procedure
- Select File > Import.
- From the list of available wizards select Table and
click Next.
The Import table data from file page of the Import Table Wizard opens.
- Click Browse next to the File
name field and specify the file name and location.
The following file formats are supported:
- *.avro
- *.parquet
- *.tab
- *.ctab
- *.txt
- *.xml
- *.ixf
- *.csv
- *.dbf
- *.xls
- *.xlsx
-
Click Next.
- If you import the table contents from
*.txt
or*.csv
files, the CSV File Import page opens. For information about the import options, see Importing query results from CSV and text files. - If you import
*.xls
or*.xlsx
files, the Excel File Import page opens. For information about the import options, see Importing query results from Excel files.Note: If the Excel file that you want to import includes multiple spreadsheets and you want to import at least two of them, you must access the Excel File Import wizard in a different way. From the main menu, select File > Import. In the Import wizard, select Excel file and click Next.
- If you import the table contents from
-
Specify the options for the sheet and click Next.
The Select results and destination information page opens.
-
Select the database from the Database list.
To easily identify the database, the Database list displays the type of the database, such as Relational, Cloudant, Kafka and so on, in angle brackets.- If you
select a Cloudant database to save the data of the query results, complete the following steps based
on the type of Cloudant database that you select:
- For a non-partitioned Cloudant database, specify a value in the Identifier field, and then click Finish.
- For a partitioned Cloudant database, specify values in the Partition Key
and Identifier fields, and then click Finish.
You can either enter a new partition key, specify the name of an existing partition key, or click Load keys, and then select a key from the Partition Key list.
Identifier is an optional field. By using the identifier, you can tag the data that you import or export to Cloudant, and then use this identifier to query only the data that you tagged.
- If you select Kafka database, the name of the file that is being imported is displayed in the Stream name field. Verify the file name and click Finish. You can also rename the file, if you want.
- If you select a relational database, complete the following steps:
- Specify the table owner name in the Table owner field and the table name in the Table name field.
- Click Next. The Set
up acceleration options page opens.Restriction: The Set up acceleration options page opens only if the following conditions are met:
- The database that you selected is a Db2 z/OS database that supports IDAA.
- The Enable acceleration resource limit is enabled.
- On the Set up acceleration options page, specify the
destination where you want import the target table data.
If you select the Database and accelerator or the Accelerator only option, select the accelerator that you want to use from the Accelerator list and use the Accelerator database field to specify the accelerator database where you want to save the data.
- Click Next
The Set up save options page of the Import Table wizard opens.
- Specify All - Result set only for the What data?
option. Note: Since you are retrieving data from a file rather than a query, all rows and columns are imported.
- Specify the Existing Data option.Use the radio buttons to specify how to save the existing data to the database table:
- Replace any existing data to replace any existing data in the database table with the contents of the import file.
- Add to any existing data to append the import file contents to any data that already resides in the database table.
- Click Finish.
- If you
select a Cloudant database to save the data of the query results, complete the following steps based
on the type of Cloudant database that you select:
Results
The Import Table wizard closes and the data contained in the file is saved to the database table.