HDFql Reference Manual v2.6.0

5.2.11hdfql_cursor_get_data_type

Syntax

int hdfql_cursor_get_data_type(const HDFQL_CURSOR *cursor)

Description

Get the data type of a cursor named cursor. The data type 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 data type is undefined (HDFQL_UNDEFINED). Please refer to Table 6.3 for a complete enumeration of HDFql data types.

Parameter(s)

cursor – pointer to a cursor to get its data type. If the pointer is NULL (in C), the data type of 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 data type of the cursor in use is returned instead).

Return

int – depending on the data type of the cursor or its state (i.e. whether it has never been populated or has been initialized or cleared), it can be HDFQL_TINYINT, HDFQL_UNSIGNED_TINYINT, HDFQL_SMALLINT, HDFQL_UNSIGNED_SMALLINT, HDFQL_INT, HDFQL_UNSIGNED_INT, HDFQL_BIGINT, HDFQL_UNSIGNED_BIGINT, HDFQL_FLOAT, HDFQL_DOUBLE, 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, HDFQL_VARCHAR, HDFQL_OPAQUE, HDFQL_BITFIELD, HDFQL_ENUMERATION, HDFQL_COMPOUND, HDFQL_REFERENCE, or HDFQL_UNDEFINED.

Example(s)

// show (i.e. get) working directory currently in use 
hdfql_execute("SHOW USE DIRECTORY"); 

// display data type of the cursor in use (should be "Data type of cursor is 2097152") 
printf("Data type of cursor is %d\n", hdfql_cursor_get_data_type(NULL)); 

// clear the cursor in use 
hdfql_cursor_clear(NULL);

// display (again) data type of the cursor in use (should be "Data type of cursor is -1") 
printf("Data type of cursor is %d\n", hdfql_cursor_get_data_type(NULL));