The function owner and the
For details on how Derby matches functions to Java methods,
see
If schema-Name is not provided, the current schema is the default schema. If a qualified procedure name is specified, the schema name cannot begin with SYS.
PararameterName must be unique within a function.
The syntax
of DataType is described in
The syntax
of DataType is described in
This is the return type of a table function. Currently, only Derby-style table functions are supported.
They are functions which return JDBC ResultSets. For more information, see
"Programming Derby-style table functions" in the
At run-time, as values are read out of the user-supplied ResultSet, Derby coerces those values to the data types declared in the CREATE FUNCTION statement. This affects values typed as CHAR, VARCHAR, LONG VARCHAR, CHAR FOR BIT DATA, VARCHAR FOR BIT DATA, LONG VARCHAR FOR BIT DATA, and DECIMAL/NUMERIC. Values which are too long are truncated to the maximum length declared in the CREATE FUNCTION statement. In addition, if a String value is returned in the ResultSet for a column of CHAR type and the String is shorter than the declared length of the CHAR column, Derby pads the end of the String with blanks in order to stretch it out to the declared length.
The syntax
of DataType is described in
JAVA- the database manager will call the function as a public static method in a Java class.
String describes
the Java method to be called when the function is executed, and takes the
following form:
Declares that the function is deterministic, meaning that with the same
set of input values, it always computes the same result. The default is NOT
DETERMINISTIC.
The function will use a parameter-passing convention that conforms to the Java language and SQL Routines specification. INOUT and OUT parameters will be passed as single entry arrays to facilitate returning values. Result sets can be returned through additional parameters to the Java method of type java.sql.ResultSet[] that are passed single entry arrays.
The PARAMETER STYLE is DERBY_JDBC_RESULT_SET if and only if this
is a Derby-style table function, that is, a function which returns
If SQL authorization mode is enabled, a function runs by default with the privileges specified for the user who invokes the function (invoker's rights). To specify that the function should run with the privileges specified for the user who defines the function (definer's rights), create the function with EXTERNAL SECURITY DEFINER. Those privileges include the right to set the current role to a role for which the definer has privileges. When the function is first invoked, no role is set; even if the invoker has set a current role, the function running with definer's rights has no current role set initially.
See
When a function with definer's rights is invoked, the current default schema is set to the eponymously named schema of the definer. For example, if the defining user is called OWNER, the default schema will also be set to OWNER.
When a function with invoker's rights is called, the current default schema and current role are unchanged initially within the function. Similarly, if SQL authorization mode is not enabled, the current default schema is unchanged initially within the function.
When the call returns, any changes made inside the function to the default current schema (and current role, if relevant) are reset (popped).
If SQL authorization mode is not enabled, an attempt to create a function with EXTERNAL SECURITY will result in an error.
Indicates whether the function issues any SQL statements and, if so, what type.
Specifies whether the function is called if any of the input arguments is null. The result is the null value.
The function elements may appear in any order, but each type of element can only appear once. A function definition must contain these elements: