HDFql Reference Manual v2.6.0

6.7.24SHOW USERBLOCK SIZE

Syntax

SHOW USERBLOCK SIZE [file_name [, file_name]*]

[post_processing_option]

[output_redirecting_option]

Description

Show (i.e. get) the size (in bytes) of a user-defined block of data stored within an HDF5 file named file_name or within the HDF5 file currently in use. Multiple files’ user-defined blocks of data sizes can be checked at once by separating their names with a comma (,). If file_name was not found or its user-defined block of data size could not be obtained (due to unknown/unexpected reasons), no subsequent files are checked, and an error is raised.

Parameter(s)

file_name – optional string that specifies the name of the HDF5 file whose user-defined block of data size (in bytes) is to be obtained. If file_name is specified, the file is opened on the fly, the user-defined block of data size is obtained, and the file is subsequently closed. If not specified, the file currently in use is used instead.

post_processing_option – optional option that transforms the result set according to the programmer’s needs, such as ordering or truncating (please refer to the section PROCESSING for additional information).

output_redirecting_option – optional option that specifies the cursor in use, an HDF5 object (i.e. dataset or attribute), a (text, binary, or Excel) file, or memory (i.e. user-defined variable) to write the result set into (please refer to the subsection INTO for additional information). If not specified, the cursor in use is populated with the result set instead (please refer to the chapter CURSOR for additional information).

Return

The size (in bytes) of a user-defined block of data stored within an HDF5 file as an HDFQL_BIGINT.

Example(s)

# create an HDF5 file named "my_file0.h5" with no user-defined block of data 
CREATE FILE my_file0.h5

# show (i.e. get) size (in bytes) of the user-defined block of data stored within file "my_file0.h5" (should return 0)
SHOW USERBLOCK SIZE my_file0.h5

# create an HDF5 file named "my_file1.h5" with a user-defined block of data (size 512) storing values 50, 60, and 70
CREATE FILE my_file1.h5 USERBLOCK SIZE 512 VALUES(50, 60, 70)

# show (i.e. get) size (in bytes) of the user-defined block of data stored within file "my_file1.h5" (should return 512)
SHOW USERBLOCK SIZE my_file1.h5

# create an HDF5 file named "my_file2.h5" with a user-defined block of data (size 8192) storing values from a binary file named "my_file.pdf"
CREATE FILE my_file2.h5 USERBLOCK SIZE 8192 VALUES FROM BINARY FILE my_file.pdf

# use (i.e. open) HDF5 file "my_file2.h5" 
USE FILE my_file2.h5

# show (i.e. get) size (in bytes) of the user-defined block of data stored within the file currently in use (should return 8192)
SHOW USERBLOCK SIZE