# 5.2.11 hdfql_cursor_get_data_type

Part of: [5 Application Programming Interface](5-application-programming-interface.md) › [5.2 Functions](5-2-functions.md)

### 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)](6-6-data-query-language-dql.md) or [DATA INTROSPECTION LANGUAGE (DIL)](6-7-data-introspection-language-dil.md) 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](5-1-constants.md#hdfql_undefined)). Please refer to [Table 6.3](6-1-data-types.md#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](5-1-constants.md#hdfql_tinyint), [HDFQL_UNSIGNED_TINYINT](5-1-constants.md#hdfql_unsigned_tinyint), [HDFQL_SMALLINT](5-1-constants.md#hdfql_smallint), [HDFQL_UNSIGNED_SMALLINT](5-1-constants.md#hdfql_unsigned_smallint), [HDFQL_INT](5-1-constants.md#hdfql_int), [HDFQL_UNSIGNED_INT](5-1-constants.md#hdfql_unsigned_int), [HDFQL_BIGINT](5-1-constants.md#hdfql_bigint), [HDFQL_UNSIGNED_BIGINT](5-1-constants.md#hdfql_unsigned_bigint), [HDFQL_FLOAT](5-1-constants.md#hdfql_float), [HDFQL_DOUBLE](5-1-constants.md#hdfql_double), [HDFQL_CHAR](5-1-constants.md#hdfql_char), [HDFQL_VARTINYINT](5-1-constants.md#hdfql_vartinyint), [HDFQL_UNSIGNED_VARTINYINT](5-1-constants.md#hdfql_unsigned_vartinyint), [HDFQL_VARSMALLINT](5-1-constants.md#hdfql_varsmallint), [HDFQL_UNSIGNED_VARSMALLINT](5-1-constants.md#hdfql_unsigned_varsmallint), [HDFQL_VARINT](5-1-constants.md#hdfql_varint), [HDFQL_UNSIGNED_VARINT](5-1-constants.md#hdfql_unsigned_varint), [HDFQL_VARBIGINT](5-1-constants.md#hdfql_varbigint), [HDFQL_UNSIGNED_VARBIGINT](5-1-constants.md#hdfql_unsigned_varbigint), [HDFQL_VARFLOAT](5-1-constants.md#hdfql_varfloat), [HDFQL_VARDOUBLE](5-1-constants.md#hdfql_vardouble), [HDFQL_VARCHAR](5-1-constants.md#hdfql_varchar), [HDFQL_OPAQUE](5-1-constants.md#hdfql_opaque), [HDFQL_BITFIELD](5-1-constants.md#hdfql_bitfield), [HDFQL_ENUMERATION](5-1-constants.md#hdfql_enumeration), [HDFQL_COMPOUND](5-1-constants.md#hdfql_compound), [HDFQL_REFERENCE](5-1-constants.md#hdfql_reference), or [HDFQL_UNDEFINED](5-1-constants.md#hdfql_undefined).

### Example(s)

```c
// 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));
```
