CREATE FUNCTION Statement (Java UDF)

Creates a new external Java table UDF function in the database.

Syntax

CREATE [ OR REPLACE | TEMPORARY ] FUNCTIONowner.]function-name  ( [ parameter, … ] )
 RETURNS data-type routine-characteristics
 SQL SECURITYINVOKER | DEFINER } ]
 { compound-statement
  AS tsql-compound-statementEXTERNAL NAME 'java-call' LANGUAGE JAVA }

Parameters

Examples

Usage

LONG BINARY and LONG VARCHAR are not permitted as return-value data types.

EXTERNAL NAME LANGUAGE JAVA—A function that uses EXTERNAL NAME with a LANGUAGE JAVA clause is a wrapper around a Java method.

iq-environment-name: JAVA [ ALLOW | DISALLOW SERVER SIDE REQUESTS ]:

DISALLOW is the default.

ALLOW indicates that server-side connections are allowed.

Note: Do not specify ALLOW unless necessary. A setting of ALLOW slows down certain types of SAP Sybase IQ table joins.

Do not use UDFs with both ALLOW SERVER SIDE REQUESTS and DISALLOW SERVER SIDE REQUESTS in the same query.

Standards

  • SQL—ISO/ANSI SQL compliant.

  • Sybase—Not supported by Adaptive Server Enterprise.

Permissions

For function to be owned by self – Requires the CREATE PROCEDURE system privilege

For function to be owned by any user – Requires one of:
  • CREATE ANY PROCEDURES system privilege.
  • CREATE ANY OBJECT system privilege.
To create a function containing an external reference, regardless of whether or not they are the owner of the function, also requires the CREATE EXTERNAL REFERENCE system privilege.