Hitachi

Hitachi Advanced Database Command Reference


14.3.3 Exporting the retrieval results of an SQL statement

This example exports table data under the following conditions:

[Figure]

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

Procedure
  1. Create an output data path file.

  2. Create an export option file.

  3. Create an SQL statement file.

  4. Execute the adbexport command.

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

Organization of this subsection

(1) Creating an output data path file

This example creates an output data path file and specifies in it paths for all the output data files.

Example specification of an output data path file
/mnt/diska/wwwww/exp1.csv
/mnt/diskb/xxxxx/exp2.csv
/mnt/diskc/yyyyy/exp3.csv
/mnt/diskd/zzzzz/exp4.csv

(2) Creating an export option file

This example creates an export option file and specifies export options in it.

Example specification of an export option file
set adb_export_rthd_num = 3           ...1
set adb_export_scan_buff_size = 64    ...2
Explanation:
  1. Specifies the number of processing real threads to be used for executing the adbexport command.

  2. Specifies the size of the buffer to be used for retaining table data retrieval results.

(3) Creating an SQL statement file

This example creates an SQL statement file and specifies in it the SQL statement to be used to retrieve the desired data.

Example specification of an SQL statement file
SELECT * FROM "TABLE01"
     WHERE "C1" < 10000

(4) Executing the adbexport command

adbexport -u ADBUSER01                             ...1
          -p '#HelloHADB_01'                       ...2
          -z /home/adbmanager/exp_file/env01.txt   ...3
          -q /home/adbmanager/exp_file/sel01.txt   ...4
          /home/adbmanager/exp_file/expf01.txt     ...5
Explanation:
  1. Specifies the authorization identifier of the HADB user who executes the adbexport command.

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

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

  4. Specifies the absolute path name of the SQL statement file created in (3) Creating an SQL statement file.

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