Hitachi

Hitachi Advanced Database Command Reference


17.3.1 Importing table data in CSV format

This example imports table data under the following conditions:

[Figure]

This example uses the following procedure to execute the adbimport command.

Procedure
  1. Create an input data path file.

  2. Create an import option file.

  3. Execute the adbimport command.

Using examples, the following subsections explain each of these steps.

Organization of this subsection

(1) Creating an input data path file

This example creates an input data path file and specifies in it the paths of the two input data files.

Example of an input data path file
/mnt/diska/wwwww/imp1.csv
/mnt/diskb/xxxxx/imp2.csv

(2) Creating an import option file

This example creates an import option file that specifies import options.

Example of an import option file
set adb_import_errdata_file_name = "/home/adbmanager/imp_file/errdata.csv"   ...1
set adb_import_errdata_num = 500                                             ...2
set adb_import_rthd_num = 2                                                  ...3
set adb_import_sort_buff_size = 2
           :
Explanation:
  1. Specifies a logical error data file to which logical error data is to be output.

  2. Specifies the maximum number of logical error data items that can be output.

  3. Specifies other performance-related import options.

(3) Executing the adbimport command

adbimport -u ADBUSER01                             ...1
          -p '#HelloHADB_01'                       ...2
          -k "'"                                   ...3
          -s ,                                     ...4
          -g 10                                    ...5
          -w /home/adbmanager/tmp                  ...6
          -z /home/adbmanager/imp_file/env01.txt   ...7
          TABLE01                                  ...8
          /home/adbmanager/imp_file/inf01.txt      ...9
Explanation:
  1. Specifies the authorization identifier of the HADB user who executes the adbimport command.

  2. Specifies the password for the authorization identifier that is specified in the -u option.

  3. Specifies the enclosing character (single quotation mark) used in the input data files. If the single quotation mark is used as the enclosing character, each single quotation mark must be enclosed in double quotation marks (").

  4. Specifies the delimiter (comma) used in the input data files.

  5. Specifies that a data import progress message (KFAA80205-I) is to be output after every 10,000 rows.

  6. Specifies a directory for storing temporary work files that will be created during data import processing.

  7. Specifies the absolute path name of the import option file created in (2) Creating an import option file.

  8. Specifies the table that is to be the target of import processing (TABLE01).

  9. Specifies the absolute path name of the input data path file created in (1) Creating an input data path file.