External Routine Reference
Include the External Routine Reference clause when you write an external routine. This option is not available for SPL routines.
Syntax
Usage
If
the IFX_EXTEND_ROLE configuration parameter is set to ON
or
to 1
, authorization to use this segment is available
only to the Database Server Administrator (DBSA), and to users whom
the DBSA has granted the EXTEND role. By default, the DBSA is user informix.
In addition, you cannot create an external routine unless you hold
the Resource or DBA privilege on the database, and also hold the Usage
privilege on the external programming language in which the routine
is written. For the syntax of the GRANT USAGE ON LANGUAGE C and GRANT
USAGE ON LANGUAGE JAVA statements of SQL, see Language-Level Privileges.
- Pathname to the executable object code, stored in a shared-object
file
For C routines, this file is either a DLL or a shared library, depending on your operating system.
For Java routines, this file is a jar file. Before you can create a UDR written in the Java language, you must assign a jar identifier to the external jar file with the sqlj.install_jar procedure. For more information, see sqlj.install_jar.
- The name of the programming language in which the UDR is written
- The parameter style of the UDR
By default, the parameter style is ONEDB. (This implies that if you specify OUT or INOUT parameters, the OUT or INOUT values are passed by reference.)
- The VARIANT or NOT VARIANT option. If you specify neither, the default is VARIANT. If the routine includes any statement of SQL it is a VARIANT routine. If a DDL statement that includes the External Routine Reference clause also includes the Routine Modifier clause, do not classify the same UDR as VARIANT in one of these clauses and as NOT VARIANT in the other.
Example
CREATE FUNCTION delete_order(int) RETURNING int
EXTERNAL NAME 'informix.demo_jar:delete_order.delete_order()'
LANGUAGE JAVA;