# eXtremeSQL Miscellaneous Functions

> Please use the links in the table below to view the eXtremeSQL miscellaneous functions:

> choice(condition, then_value, else_value) | Returns the second or third argument converted to string depending on the boolean value of the first argument
> env(var) | Returns the value of the specified OS environment variable `var`
> coalesce(...) | Return the first non-null value in a list of arguments
> generate_series(start, stop) | Return sequential numbers from the `start` to the `stop` values
> format(fmt, val) | Formats the value `val` according to the format specified by the format string `fmt`. If val is of type `datetime`, then `fmt` must be a string suitable for `strftime()`. For numeric and string values `fmt` must be a string suitable for `printf()`. Values of other types are converted to string
> get_last_autoid() | Returns the `autoid` of the last object created by this connection
> ifnull(x,y) | Return the first argument if null, otherwise return the second argument
> nullifzero(x) | Return null if the first argument is zero, otherwise return the first argument
> hashcode(val) | Returns a hash code for the value `val`
> length(a) | Returns the number of elements in an array
> signature(str) | Returns the string's signature (set of used characters) as a 64-bit mask
> psignature(str) | Returns the string's signature (set of used characters) as a 64-bit mask skipping pattern special symbols '_', '%' and '\<x>'
> usignature(ustr) | Returns the unicode string's signature (set of used characters) as a 64-bit mask
> upsignature(ustr) | Returns the unicode string's signature (set of used characters) as a 64-bit mask skipping pattern special symbols '_', '%' and '\<x>'
> file_backup() | Perform a file backup for a persistent database
> fs_cache_warmup() | Load database files into the file system cache
> disk_cache_usage() | Estimate the amount of cache space used
> seq_skip_nan() | Sequence function used to omit NaN (Not-a-Number) values in SQL sequence operations
> set_free_memroy_threshold() | Set the threshold to abort the current transaction if the amount of free memory becomes lower
> start_profile(rate_usec) | Start connection lock profiling
> stop_profile() | Stop connection lock profiling and output the connections' states