11.1.8 Outputting data from a base table to a file (data export)
You can output data from a base table to a file by using either of the following two methods:
-
Executing the adbexport command
You can output data from a base table to a file by executing the adbexport command.
-
To output all the data that is stored in a base table, execute the adbexport command by specifying table-to-be-processed for the -n option.
The command outputs the data that is stored in the table specified for the -n option.
-
To output only the data that satisfies specific conditions from the target base table, execute the adbexport command by specifying the -q option.
The command executes a search based on the SQL statement written in the SQL statement file specified for the -q option, and outputs the result of the search.
The adbexport command can output data in a shorter time than the adbsql command. Note, however, that the adbexport command can be executed by the HADB server, but cannot be executed by an HADB client.
For details about the adbexport command, see adbexport (Export Data) in the manual HADB Command Reference.
-
-
Executing the adbsql command
When you use the adbsql command to search a base table for data and redirect the search result, you can output data from the base table to a file.
Note that the adbsql command can be executed by the HADB server and by an HADB client (Linux version).
For details about the adbsql command, see adbsql (Execute SQL Statements) in the manual HADB Command Reference.
Normally, we recommend that you use the adbexport command when outputting data from a base table. Use the adbsql command only when an HADB client (Linux version) needs to output data from a base table to a file.
- Important
-
To output data from a chunk in wait status, perform either of the following operations:
-
Outputting the data that is stored in a chunk in wait status by specifying the chunk ID
If you specify a chunk ID in the adbexport or adbsql command, the command can also output data from a chunk in wait status. For details, see 11.4.5 Exporting data in units of chunks.
-
Changing a chunk in wait status to a chunk in normal status
If a chunk is in normal status, both of the preceding two methods can output data from the chunk. Therefore, use the adbchgchunkstatus command to change the status of the chunk from wait status to normal status. For details, see 11.4.12 Changing the chunk status.
-