6.2.5STEP
Syntax
STEP {step_value | {, substep_value} | {step_value, substep_value}}
Description
Step (i.e. jump) through the result set at every step_value position. In other words, all elements between steps are discarded from the result set. Additionally, if the result set is of data type HDFQL_CHAR, HDFQL_VARTINYINT, HDFQL_UNSIGNED_VARTINYINT, HDFQL_VARSMALLINT, HDFQL_UNSIGNED_VARSMALLINT, HDFQL_VARINT, HDFQL_UNSIGNED_VARINT, HDFQL_VARBIGINT, HDFQL_UNSIGNED_VARBIGINT, HDFQL_VARFLOAT, HDFQL_VARDOUBLE, or HDFQL_OPAQUE, the result subset can be stepped (i.e. jumped) through by specifying substep_value.
Parameter(s)
step_value – optional integer that specifies the position to step (i.e. jump) a result set. If negative, the STEP option will step (i.e. jump) the result set starting from its end.
substep_value – optional integer that specifies the position to step (i.e. jump) a result set. If negative, the STEP option will step (i.e. jump) the result set starting from its end. Of note, this parameter is only applicable to a result set of one of the aforementioned data types and is ignored otherwise.
Return
The result set and/or subset is stepped (i.e. jumped) through according to the specified position.
Example(s)
# create an HDF5 dataset named "my_dataset0" of data type float of four dimensions (size 5x8x4x7)
CREATE DATASET my_dataset0 AS FLOAT(5, 8, 4, 7)
# show (i.e. get) dimensions of dataset "my_dataset0" and populate cursor in use with these (should return 5, 8, 4, 7)
SHOW DIMENSION my_dataset0
# show (i.e. get) dimensions of dataset "my_dataset0" and populate cursor in use with these (should return 5, 8, 4, 7)
SHOW DIMENSION my_dataset0 STEP 1
# show (i.e. get) dimensions of dataset "my_dataset0" and populate cursor in use with every second dimension (should return 5, 4)
SHOW DIMENSION my_dataset0 STEP 2
# show (i.e. get) dimensions of dataset "my_dataset0" and populate cursor in use with every second dimension starting from the end (should return 8, 7)
SHOW DIMENSION my_dataset0 STEP -2
# show (i.e. get) dimensions of dataset "my_dataset0" and populate cursor in use with every third dimension (should return 5, 7)
SHOW DIMENSION my_dataset0 STEP 3
# create an HDF5 dataset named "my_dataset1" of data type variable-length int of one dimension (size 3) with initial values of 12, 14, and 16 for the first position, 18 for the second position, and 20, 22, 24, and 26 for the third position
CREATE DATASET my_dataset1 AS VARINT(3) VALUES((12, 14, 16), (18), (20, 22, 24, 26))
# select (i.e. read) data from dataset "my_dataset1" and populate cursor in use with it (should return 12, 14, 16, 18, 20, 22, 24, 26)
SELECT FROM my_dataset1
# select (i.e. read) data from dataset "my_dataset1" and populate cursor in use with values of every second position (should return 12, 14, 16, 20, 22, 24, 26)
SELECT FROM my_dataset1 STEP 2
# select (i.e. read) data from dataset "my_dataset1" and populate cursor in use with every third value of all positions (should return 12, 18, 20, 26)
SELECT FROM my_dataset1 STEP , 3
# select (i.e. read) data from dataset "my_dataset1" and populate cursor in use with every second value of every second position (should return 12, 16, 22, 26)
SELECT FROM my_dataset1 STEP 2, -2