HDFql Reference Manual v2.6.0

6.7.18SHOW PAD

Syntax

SHOW PAD [DATASET | ATTRIBUTE] [file_name] object_name [BY NAME]

[post_processing_option]

[output_redirecting_option]

Description

Show (i.e. get) the padding of an HDF5 dataset or attribute or of its members named object_name. In case a dataset and an attribute with identical names (object_name) are stored in the same location (i.e. group) and neither the keyword DATASET nor ATTRIBUTE is specified, the padding returned belongs to the dataset. To explicitly get the padding of object_name according to its type, the keyword DATASET or ATTRIBUTE must be specified. If object_name ends with “/” and is of data type HDFQL_COMPOUND, the paddings of the members of object_name are returned instead.

Parameter(s)

file_name – optional string that specifies the name of the HDF5 file storing the dataset or attribute whose padding is to be obtained. If file_name is specified, the file is opened on the fly, the padding of the dataset or attribute is obtained, and the file is subsequently closed. If not specified, the file currently in use is used instead.

object_name – mandatory string that specifies the name of the HDF5 dataset or attribute whose padding is to be obtained, or the paddings of its members if the name ends with “/” and the dataset or attribute is of data type HDFQL_COMPOUND.

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

If the keyword BY NAME is not specified, it returns the padding of an HDF5 dataset or attribute as an HDFQL_INT, which can be HDFQL_NULLTERM, HDFQL_NULLPAD, HDFQL_SPACEPAD, or HDFQL_UNDEFINED depending on whether the padding is null terminated, null padded, space padded, or undefined (i.e. the dataset or attribute is neither of data type HDFQL_CHAR nor HDFQL_VARCHAR), respectively. Otherwise, if the keyword BY NAME is specified, it returns the padding of a dataset or attribute as an HDFQL_VARCHAR, which can be “NULLTERM”, “NULLPAD”, “SPACEPAD”, or “UNDEFINED”.

Example(s)

# create an HDF5 dataset named "my_dataset0" of data type char 
CREATE DATASET my_dataset0 AS CHAR

# show (i.e. get) padding of dataset "my_dataset0" (should return 1 (i.e. HDFQL_NULLTERM)) 
SHOW PAD my_dataset0

# create an HDF5 dataset named "my_dataset1" of data type char of one dimension (size 20) using the null padded representation
CREATE DATASET my_dataset1 AS CHAR(20) NULLPAD

# show (i.e. get) padding of dataset "my_dataset1" (should return 2 (i.e. HDFQL_NULLPAD)) 
SHOW PAD my_dataset1

# create an HDF5 attribute named "my_attribute0" of data type compound composed of three members named "m0" (of data type char), "m1" (of data type int), and "m2" (of data type variable-length char using the space padded representation)
CREATE ATTRIBUTE my_attribute0 AS COMPOUND(m0 AS CHAR, m1 AS INT, m2 AS VARCHAR SPACEPAD)

# show (i.e. get) padding of attribute "my_attribute0" (should return -1 (i.e. HDFQL_UNDEFINED))
SHOW PAD my_attribute0

# show (i.e. get) padding of members of attribute "my_attribute0" (should return 1 (i.e. HDFQL_NULLTERM), -1 (i.e. HDFQL_UNDEFINED), 4 (i.e. HDFQL_SPACEPAD))
SHOW PAD my_attribute0/

# create an HDF5 dataset named "my_common" of data type char using the null padded representation
CREATE DATASET my_common AS CHAR NULLPAD

# create an HDF5 attribute named "my_common" of data type variable-length char using the null terminated padded representation
CREATE ATTRIBUTE my_common AS VARCHAR NULLTERM

# show (i.e. get) padding of dataset "my_common" (should return 2 (i.e. HDFQL_NULLPAD)) 
SHOW PAD my_common

# show (i.e. get) padding of dataset "my_common" (should return 2 (i.e. HDFQL_NULLPAD)) 
SHOW PAD DATASET my_common

# show (i.e. get) padding of attribute "my_common" (should return 1 (i.e. HDFQL_NULLTERM)) 
SHOW PAD ATTRIBUTE my_common