Call a UDR through an SQL statement

You can call any registered UDR in an SQL statement. When your UDR is called in an SQL statement, the database server parses the statement and produces a query plan. It then automatically performs any routine resolution necessary and loads the shared-object file in which that UDR is loaded into shared memory (if it is not already loaded) when it parses and compiles the SQL statement.

Within the DataBlade® API, you can execute SQL statements with the mi_exec() function and execute prepared SQL statements with the mi_exec_prepared_statement() function. For example, the following call to mi_exec() sends the EXECUTE FUNCTION statement to the database server to execute the myfunc() user-defined function:
mi_exec(conn, "EXECUTE FUNCTION myfunc(5,5);",
   MI_QUERY_BINARY);