RETURNS NULL ON NULL INPUT
Derby Reference Manual
32
RETURNS NULL ON NULL INPUT or CALLED ON NULL INPUT
Specifies whether the function is called if any of the input arguments is null. The result is
the null value.
RETURNS NULL ON NULL INPUT
Specifies that the function is not invoked if any of the input arguments is null. The
result is the null value.
CALLED ON NULL INPUT
Specifies that the function is invoked if any or all input arguments are null. This
specification means that the function must be coded to test for null argument values.
The function can return a null or non-null value. This is the default setting.
The function elements may appear in any order, but each type of element can only
appear once. A function definition must contain these elements:
· LANGUAGE
· PARAMETER STYLE
· EXTERNAL NAME
Example of declaring a scalar function
CREATE FUNCTION TO_DEGREES
( RADIANS DOUBLE )
RETURNS DOUBLE
PARAMETER STYLE JAVA
NO SQL LANGUAGE JAVA
EXTERNAL NAME 'java.lang.Math.toDegrees'
Example of declaring a table function
CREATE FUNCTION PROPERTY_FILE_READER
( FILENAME VARCHAR( 32672 ) )
RETURNS TABLE
(
KEY_COL VARCHAR( 10 ),
VALUE_COL VARCHAR( 1000 )
)
LANGUAGE JAVA
PARAMETER STYLE DERBY_JDBC_RESULT_SET
NO SQL
EXTERNAL NAME 'vtis.example.PropertyFileVTI.propertyFileVTI'
CREATE INDEX statement
A CREATE INDEX statement creates an index on a table. Indexes can be on one or
more columns in the table.
Syntax
(
[ ASC | DESC ]
[ ,
The maximum number of columns for an index key in Derby is 16.
An index name cannot exceed 128 characters.
A column must not be named more than once in a single CREATE INDEX statement.
Different indexes can name the same column, however.
Derby can use indexes to improve the performance of data manipulation statements (see
Tuning Derby). In addition, UNIQUE indexes provide a form of data integrity checking.
Index names are unique within a schema. (Some database systems allow different tables
in a single schema to have indexes of the same name, but Derby does not.) Both index
and table are assumed to be in the same schema if a schema name is specified for one