# 5.2.56 hdfql_variable_get_data_type

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

### Syntax

int hdfql_variable_get_data_type(const void \*_variable_)

### Description

Get the data type of the result set stored in a variable named _variable_. 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 memory – and not to the data type of _variable_ declared in the program. If _variable_ has been registered but has never been populated through a redirection operation, 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)

_variable_ – pointer to a variable whose data type is to be obtained.

### Return

int – depending on the success in getting the data type of the variable, 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), [HDFQL_UNDEFINED](5-1-constants.md#hdfql_undefined), [HDFQL_ERROR_NO_ADDRESS](5-1-constants.md#hdfql_error_no_address), or [HDFQL_ERROR_NOT_REGISTERED](5-1-constants.md#hdfql_error_not_registered).

### Example(s)

```c
// declare variables 
char script[1024]; 
char data[1024];

// register variable "data" for subsequent use (by HDFql) 
hdfql_variable_register(data);

// prepare script to show (i.e. get) working directory currently in use and populate variable "data" with it
sprintf(script, "SHOW USE DIRECTORY INTO MEMORY %d", hdfql_variable_get_number(data));

// execute script 
hdfql_execute(script); 

// display data type of variable "data" (should be "Data type of variable is 2097152") 
printf("Data type of variable is %d\n", hdfql_variable_get_data_type(data));
```
