Registers a specified foreign function.
FUNCTION Ora_Ffi.Register_Function
(libHandle libHandleType,
funcname VARCHAR2,
callstd NUMBER := C_STD)
RETURN funcHandleType;
Parameter | Description |
---|---|
libHandle | A library handle returned by Ora_Ffi.Load_Library or Ora_Ffi.Find_Library. |
funcname | The name of the function to be registered. |
callstd |
The calling used by the foreign function. (For more information, refer to your compiler documentation.) The value of this argument may be one of the following packaged constants: C_STD means the foreign function uses the C calling standard. PASCAL_STD means the foreign function uses the Pascal calling standard. |
A handle to the foreign function.
/* Define Procedure define_c_funcs which calls two
Ora_Ffi functions, getresult and foo. */
PROCEDURE define_c_funcs is
getresult_fhandle ora_ffi.funcHandleType;
foo_fhandle ora_ffi.funcHandleType;
BEGIN
/* Register the info for function getresult */
getresult_fhandle := ora_ffi.register_function
(testlib_lhandle,'getresult');
...
/* Register the info for function foo */
foo_fhandle := ora_ffi.register_function
(testlib_lhandle,'foo');
...
/* Generate PL/SQL package containing all
functions defined in test library */
ora_ffi.generate_foreign
(testlib_lhandle, 'test_ffi_pkg');
...
END;