Hitachi

Hitachi Advanced Database Command Reference


38.5.8 #GETDATA (gets data stored in a chunk)

Function

This subcommand acquires data from a specified chunk and outputs it to the standard output.

#GETDATA can be executed on multi-chunk tables.

Format
#GETDATA table-name CHUNKID=chunk-ID;
table-name

Specifies the name of the table from which data is to be acquired. HADB users (authorization identifiers) connected to the HADB server can only specify the name of a multi-chunk table for which they have the SELECT privilege.

chunk-ID

Specifies the chunk ID of a chunk from which data is to be acquired. Specify an existing chunk ID. For details about how to check chunk IDs, see Searching system tables in the HADB Setup and Operation Guide.

Note

You can use this subcommand to output data stored in the chunk of the specified chunk ID even if that chunk is in wait status.

Example

This example outputs data from a chunk (chunk ID is 1) of table T1 to a file (outfile) in CSV format.

adbsql -u ADBUSER01 -p '#HelloHADB_01' -s > outfile          ...1
#GETDATA "T1" CHUNKID=1;                                     ...2
#EXIT;                                                       ...3
Explanation:
  1. Starts the adbsql command with the -u, -p and -s options specified.

  2. Executes the #GETDATA subcommand.

    Data in a chunk (chunk ID 1) of table T1 is output to a file (outfile) in CSV format.

  3. Terminates the adbsql command.

Notes
  • The output format of #GETDATA is the same as that of the SELECT statement for searching a table specified by name. For details about the output format of the SELECT statement, see 38.7.2 Data manipulation SQL statements (SELECT statement).

  • The results of #GETDATA are output even when OFF (do not output the retrieval results) is specified in #SET DISPLAY. For details about #SET DISPLAY of the adbsql subcommand, see 38.5.12 #SET DISPLAY (outputs the retrieval results).

  • If #GETDATA is specified, the #SET EXECTIME REPORT and #SET OPT REPORT specifications are not enabled (always treated as OFF).