Function Command.execFunction

Execute a stored function, with any required input variables, and store the return value into a D variable.

For this method, no query string is to be provided. The required one is of the form "select foo(?, ? ...)". The method generates it and the appropriate bindings - in, and out. Chunked transfers are not supported in either direction. If you need them, create the parameters separately, then use execPreparedResult() to get a one-row, one-column result set.

If it is not possible to convert the column value to the type of target, then execFunction will throw. If the result is NULL, that is indicated by a false return value, and target is unchanged.

In the interest of performance, this method assumes that the user has the equired information about the number and types of IN parameters and the type of the output variable. In the same interest, if the method is called repeatedly for the same stored function, prepare() is omitted after the first call.

Prototype

bool execFunction(T, U...)(
  string name,
  ref T target,
  U args
);

WARNING

This function is not currently unittested.

Parameters

NameDescription
T The type of the variable to receive the return result.
U type tuple of arguments
name The name of the stored function.
target the D variable to receive the stored function return result.
args The list of D variables to act as IN arguments to the stored function.

Authors

Copyright

License