HDFql Reference Manual v2.6.0

5.2.14hdfql_cursor_get_dimension_count

Syntax

int hdfql_cursor_get_dimension_count(const HDFQL_CURSOR *cursor)

Description

Get the number of dimensions of the result set stored in a cursor named cursor. The number of dimensions refers to the result of a DATA QUERY LANGUAGE (DQL) or DATA INTROSPECTION LANGUAGE (DIL) operation redirected into a cursor. If cursor has never been populated or has been initialized or cleared, the returned number of dimensions is zero.

Parameter(s)

cursor – pointer to a cursor to get its number of dimensions. If the pointer is NULL (in C), the number of dimensions of the result set stored in the cursor in use is returned instead. The equivalent of a NULL pointer in C++, Java, Python, C#, Fortran, R, and MATLAB HDFql wrappers is NULL, null, None, null, NULL(), NULL, and NaN, respectively. While in C cursor is mandatory, in C++, Java, Python, C#, Fortran, R, and MATLAB it is optional (when not specified, the number of dimensions of the result set stored in the cursor in use is returned instead).

Return

int – number of dimensions of the cursor.

Example(s)

// create an HDF5 dataset named "my_dataset" of data type int of two dimensions (size 5x3) 
hdfql_execute("CREATE DATASET my_dataset AS INT(5, 3)");

// select (i.e. read) data from dataset "my_dataset" and populate cursor in use with it 
hdfql_execute("SELECT FROM my_dataset");

// display number of dimensions of the result set stored in the cursor in use (should be "Number of dimensions of result set stored in cursor is 2")
printf("Number of dimensions of result set stored in cursor is %d\n", hdfql_cursor_get_dimension_count());