Prerequisites
-
To compile a UDF into a SQL query, the UDF must have been previously created with a CREATE FUNCTION statement.
-
To execute a SQL query containing UDFs, the user executing the query must have EXECUTE privilege on every UDF referenced in the query. The user must also have the SELECT EXECUTABLE privilege on every UDF referenced in the query. These privileges are in addition to any privileges that would ordinarily be required when executing a query (such as the appropriate privileges on any tables referenced in the query). Ordinarily, a user who has EXECUTE privilege on a UDF also has SELECT EXECUTABLE privilege on that UDF. This is managed automatically by NonStop SQL/MX when the EXECUTE privilege is GRANTED or REVOKED.
-
SQL queries containing UDFs must run within the context of a transaction. If a query containing a UDF is executed without a transaction, NonStop SQL/MX will begin an implicit transaction on behalf of the query.
-
Each invocation of a UDF is limited to executing one billion instructions. If you attempt to execute more than one billion instructions in a single invocation, the query is terminated with an SVM Instruction Limit exception.