User Defined Scalar Functions are created using the CREATE FUNCTION command. User Defined Scalar Functions can be created by any user with resource privilege.
The syntax for the CREATE FUNCTION statement is:
CREATE FUNCTION [ owner_name.]function_name
( [parameter_decl , ...] )
RETURNS (data_type)
[ IMPORT
java_import_clause ]
BEGIN
java_snippet
END
parameter_decl ::
[ IN ] parameter_name data_type
When creating stored procedures, the key words BEGIN, RETURNS, IMPORT and END should start at the first column of the line. The function name is limited to 64 characters