A call specification declares a Java method or a C language subprogram so that it can be invoked from PL/SQL. You can also use the SQL
CALL statement to invoke such a method or subprogram. The call specification tells the database which Java method, or which named subprogram in which shared library, to invoke when an invocation is made. It also tells the database what type conversions to make for the arguments and return value.
To invoke a call specification, you may need additional privileges, for example,
EXECUTE privileges on a C library for a C call specification.
Maps a C procedure or Java method name, parameter types, and return type to their SQL counterparts.
Call specifications can appear in PL/SQL standalone subprograms, package specifications and bodies, and type specifications and bodies. They cannot appear inside PL/SQL blocks.
Identifies the Java implementation of the method.
Identifies a library created by the "CREATE LIBRARY Statement".
Deprecated way of declaring a C subprogram, supported only for backward compatibility. Use
EXTERNAL in a C call specification if it contains defaulted arguments or constrained PL/SQL types, otherwise use the
Example 14-6 External Function Example
The hypothetical following statement creates a PL/SQL standalone function
get_val that registers the C subprogram
c_get_val as an external function. (The parameters have been omitted from this example.)
CREATE FUNCTION get_val ( x_val IN NUMBER, y_val IN NUMBER, image IN LONG RAW ) RETURN BINARY_INTEGER AS LANGUAGE C NAME "c_get_val" LIBRARY c_utils PARAMETERS (...);
In this chapter:
In other chapters:
In other books:
Oracle Database SQL Language Reference for information about the
Oracle Database Development Guide for information about restrictions on user-defined functions that are called from SQL statements
Oracle Database Java Developer's Guide to learn how to write Java call specifications
Oracle Database Development Guide to learn how to write C call specifications