14.3.3 Exporting the retrieval results of an SQL statement
This example exports table data under the following conditions:
-
Data stored in base table TABLE01 is exported.
-
The retrieval results of the SQL statement specified in an SQL statement file are exported.
-
The export results are output to four output data files.
This example uses the following procedure to execute the adbexport command.
- Procedure
-
-
Create an output data path file.
-
Create an export option file.
-
Create an SQL statement file.
-
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:
-
-
Specifies the number of processing real threads to be used for executing the adbexport command.
-
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:
-
-
Specifies the authorization identifier of the HADB user who executes the adbexport command.
-
Specifies the password for the authorization identifier that is specified in the -u option.
-
Specifies the absolute path name of the export option file created in (2) Creating an export option file.
-
Specifies the absolute path name of the SQL statement file created in (3) Creating an SQL statement file.
-
Specifies the absolute path name of the output data path file created in (1) Creating an output data path file.
-