# 5.2.52 hdfql_variable_transient_register

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

### Syntax

int hdfql_variable_transient_register(const void \*_variable_)

### Description

Register a variable named _variable_ in a transient way for subsequent use. This function is similar to [hdfql_variable_register](5-2-51-hdfql-variable-register.md), except that after the execution of a script (via the function [hdfql_execute](5-2-1-hdfql-execute.md)) that uses _variable_, _variable_ is automatically unregistered (by HDFql), thus alleviating the programmer from having to do it.

### Parameter(s)

_variable_ – pointer to a variable to register in a transient way for subsequent use.

### Return

int – depending on the success in registering the variable in a transient way for subsequent use, it can be equal to or greater than zero (i.e. the number assigned to the variable when successfully registered), [HDFQL_ERROR_NO_ADDRESS](5-1-constants.md#hdfql_error_no_address), [HDFQL_ERROR_FULL](5-1-constants.md#hdfql_error_full), or [HDFQL_ERROR_UNEXPECTED_DATA_TYPE](5-1-constants.md#hdfql_error_unexpected_data_type).

### Example(s)

```c
// declare variables 
char script[1024];
short data[3]; 
int number;

// create an HDF5 dataset named "my_dataset" of data type short of one dimension (size 3) 
hdfql_execute("CREATE DATASET my_dataset AS SMALLINT(3)");

// populate variable "data" with certain values 
data[0] = 21; 
data[1] = 18;
data[2] = 75;

// register variable "data" in a transient way for subsequent use (by HDFql) 
number = hdfql_variable_transient_register(data);

// prepare script to insert (i.e. write) values from variable "data" into dataset "my_dataset"
sprintf(script, "INSERT INTO my_dataset VALUES FROM MEMORY %d", number);

// execute script (variable "data" is automatically unregistered immediately after the execution of the script (i.e. there is no need to explicitly unregister the variable))
hdfql_execute(script);
```
